Hello all, I want to remove all characters except the ones in my preg_replace function. Here is what I have so far: $allowed = "/[^a-z0-9\\040\\.\\-\\_\\\\]/i"; $v = preg_replace($allowed,"",$title); Code (markup): but I also want to include all instances of % characters and $ characters how should I add these? Thanks a ton! adbox
no no I just would like to leave those characters in the string, instead of removing thing with the preg_replace function. So how can I add them to the allow list already in the preg_replace function?
Sorry I'm not a RegExp person but you could try this $allowed = "/[^a-z0-9\\040\\.\\-\\_\\\\\][$][%]/i"; Code (markup):
I've only just realised that you escape by using backslash so you could add to your string \$ and \% I think I'm not actually sure but you could try that too