Results 1 to 1 of 1
Threaded View
-
19th Sep 2015, 05:42 PM #1
Easiest way to make SEO friendly links using PHP
This code removes all special characters from the given URL and make it SEO friendly.
PHP Code:<?php
function makeMyUrlFriendly($url){
$output = preg_replace("/\s+/" , "_" , trim($url));
$output = preg_replace("/\W+/" , "" , $output);
$output = preg_replace("/_/" , "-" , $output);
return strtolower($output);
}
?>Kevin Reviewed by Kevin on . Easiest way to make SEO friendly links using PHP This code removes all special characters from the given URL and make it SEO friendly. <?php function makeMyUrlFriendly($url){ $output = preg_replace("/\s+/" , "_" , trim($url)); $output = preg_replace("/\W+/" , "" , $output); $output = preg_replace("/_/" , "-" , $output); return strtolower($output); } Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Vn5socks.net 05-11-2024 | Service...
Live | 198.7.56.71:58182 | United States |...