my title consists of space,[ { } & () capital letters and several other unknown characters which i want to replace to lower character only. i am using this but as i cant predict what users will give input i am considering some sort of regex or preg replace or preg match so that only lower letters with underscore(for space) is acceptable or title is converted into all lower case with underscore.i dont want any other character like ,{[]}() & etc.
i have tried this but will prefer one line preg replace or regex
$name = str_replace(' ', '_', $cityu);
$name1 = str_replace('(', '_', $name);
$name2 = str_replace(')', '_', $name1);