Example:
PHP
<?php
function permalink($var)
{
$var=preg_replace('#([\W_]+)#',' ',$var);
$var=str_replace('?','',$var);
$var=str_replace(' ','-',$var);
$var=strtolower($var);
return $var;
}
?>
<?php
// Your title
$slug = permalink('How to create a video');
// Resule
echo 'yourdomain.com/'.$slug.'';
?>
How to create title to url/slug in PHP | PHP Function Tutorial |
Type: | Php |
Category: | Web Tutorial |
Sub Category: | PHP Function Tutorial |
Uploaded by: | Admin |