php - preg_replace and its automatic variables -
while removing bugs php code, browser shows me error:
parse error: syntax error, unexpected '1' (t_lnumber), expecting variable (t_variable) or '$' in (path)/functions.php on line 12
the line 12 of function.php following:
$file_id = preg_replace($regex,$1,$file);
and regex defined $regex #^([0-9]*)\.markdown$#
. used preg_replace in other sites same version of php (5.3). tried change $1
\\1
or $$1
did nothing.
what point code? don't understand.
you should use qoutes "$1"
following:
$file_id = preg_replace($regex,"$1",$file);
Comments
Post a Comment