php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login go to bug id or search bugs for
Bug #12614 Submitted: AddSlashes doen't escape Curly braces "{"'s 2001-08-07 06:28 UTC 2001-08-07 17:34 UTC mark at asplen dot co dot uk Not a bug Strings related 4.0CVS-2001-08-07 Linux No None
[2001-08-07 06:28 UTC] mark at asplen dot co dot uk
AFAIK this is not fixed in versoins beyong 4.0.1pl2 which is what I'm using.

I'm using PHP to modify Latex files - particularly to substitute PHP variables with values from a database.

Therefore my Latex file could contain:
\textbf{\$php_variable}

I read lines from the Latex file and use something like:
\$str = eval(\$input_line);

As the input line includes a {\$ the eval function assumes an array calculation and the { is left out of the output string.

I've fixed the problem by adding an additional str_replace to escape the { with \{ first.

Kind regards
Mark