-
Php Seo Function
Php Seo Function
<?php
function seo($str, $replace=array(), $delimiter='-'){
setlocale(LC_ALL, 'en_US.UTF8');
if( !empty($replace) ) {
$str = str_replace((array)$replace, ' ', $str);
}else{
$trArr = array('ç','Ç','ı','İ','ş','Ş','ğ','Ğ','ö','Ö', 'ü','Ü');
$toArr = array('c','c','i','i','s','s','g','g','o','o','u', 'u');
$str = str_replace($trArr,$toArr,$str);
}
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
$clean = mb_strtolower(trim($clean, '-'),'UTF-8');
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
return $clean;
}
?>
-
Your PHP function is very useful for human beings. Thanks for sharing.
Exam Questions | Test Questions | TestKiller | Exam Dumps
Last edited by jimmy carter; 02-22-2012 at 07:35 AM.
-
-
so ... what does this php script actually do ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks