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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -