PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php /* function slugify ($string) { $string = utf8_encode($string); //$string = iconv('UTF-8', 'ASCII//TRANSLIT', $string); $string = preg_replace('/[^a-z0-9- ]/i', '', $string); $string = str_replace(' ', '-', $string); $string = trim($string, '-'); $string = str_replace('--', '-', $string); $string = strtolower($string); return $string; } echo slugify("RAMAYANA (24000----SLOKAS)");*/ $projectSub = array("RAMAYANA (24000 SLOKAS)"); foreach($projectSub as $urlSlug){ //$urlSlug = $submenu['heading']; $urlSlug = utf8_encode($urlSlug); $urlSlug = iconv('UTF-8', 'ASCII//TRANSLIT', $urlSlug); $urlSlug = preg_replace('/[^a-z0-9- ]/i', '', $urlSlug); $urlSlug = str_replace(' ', '-', $urlSlug); $urlSlug = str_replace('--', '-', $urlSlug); $urlSlug = trim($urlSlug, '-'); $urlSlug = strtolower($urlSlug); echo ($urlSlug); }
Show:  
Copy Clear