I'm getting this message when I try to run a php script
Warning: preg_replace() [function.preg-replace]: Unknown modifier '.'
This is the code:
$ext = preg_replace("^.+\\.([^.]+)$", "\\1", $file);
I'm getting this message when I try to run a php script
Warning: preg_replace() [function.preg-replace]: Unknown modifier '.'
This is the code:
$ext = preg_replace("^.+\\.([^.]+)$", "\\1", $file);
You have to add an seperator for regex modifiers and the regex itself. I.e.
$ext = preg_replace("~^.+\.([^.]+)$~", "\1", $file);