This will take out any non-alphanumeric characters and replace them with an underscore
protected function convertTitleToCode($title) { return preg_replace("/[^\w]/i", "_", trim(strtolower($title))); }
This will take out any non-alphanumeric characters and replace them with an underscore
protected function convertTitleToCode($title) { return preg_replace("/[^\w]/i", "_", trim(strtolower($title))); }