Results 1 to 1 of 1
-
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 16-11-2024 | socks 5...
Live | 66.29.128.242:32459 | United States |...