Quote:
Originally posted by Mark Hensler
You could use str_replace(). I don't think you'll need the power of regular expressions, so str_replace will give you more speed.
example:
PHP Code:
$replace = array(
// array(OUT, IN),
array('[', ''),
array(']', ''),
array('.', '_'),
array(' ', '_')
);
$string = str_replace($replace[0], $replace[1], $string);
|
Very close! Didn't work for me though, so I dug in the PHP manual and ended up with this:
$search = array('[', ']', '.', ' ');
$replace = array('', '', '_', '_');
$string = str_replace($search, $replace, $string);
Works like a charm now!! Thanks for your help, got me on the right trail!!