/ Published in: PHP
Replace non alpha-numeric characters with PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Used to give the full hyperlink for news/events items * * @param $type string - events/news * @param $id int - ID of item for link * @param $title string - item title for link to strip bad chars **/ public function seo_slug ( $type, $id, $title ) { // strip bad chars $url = '/'.$type.'/d/'.$id.'/'.$slug.'/'; return $url; }