PDA

Orijinalini grmek iin tklaynz : Php'de Linkleri Sef Yapmak



optimusprime
01.Aralk.2014, 21:50
Linkleri Sef Yapmak


PHP- Kodu:


function seo($url)

{

$url = trim($url);

$url = strtolower($url);


$find = array('<b>', '</b>');

$url = str_replace ($find, '', $url);


$url = preg_replace('/<(\/{0,1})img(.*?)(\/{0,1})\>/', 'image', $url);


$find = array(' ', '&quot;', '&amp;', '&', '\r\n', '\n', '/', '\\', '+', '<', '>');

$url = str_replace ($find, '-', $url);


$find = array('', '', '', '', '', '', '', '');

$url = str_replace ($find, 'e', $url);


$find = array('', '', '', '', '', 'I', '', '', '', '', '');

$url = str_replace ($find, 'i', $url);


$find = array('', '', '', '', '', '', '', '');

$url = str_replace ($find, 'o', $url);


$find = array('', '', '', '', '', '', '', '', '', '');

$url = str_replace ($find, 'a', $url);


$find = array('', '', '', '', '', '', '', '');

$url = str_replace ($find, 'u', $url);


$find = array('', '');

$url = str_replace ($find, 'c', $url);


$find = array('', '');

$url = str_replace ($find, 's', $url);


$find = array('', '');

$url = str_replace ($find, 'g', $url);


$find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/');


$repl = array('', '-', '');


$url = preg_replace ($find, $repl, $url);

$url = str_replace ('--', '-', $url);


return $url;

}


$yazi = "ebnem Ferah / Babam Olum ( dinle )";

$echo seo($yazi);




?>