URL Slug aus String erstellen
<?php
function generateSlug($string)
{
$slug=preg_replace('/[^A-Za-z0-9-]+/', '-', $string);
return $slug;
}
echo generateSlug('this is simple text');
//kehrt 'this-is-simple-text' zurück
?>
<?php
function generateSlug($string)
{
$slug=preg_replace('/[^A-Za-z0-9-]+/', '-', $string);
return $slug;
}
echo generateSlug('this is simple text');
//kehrt 'this-is-simple-text' zurück
?>