Re: eval( ) statement yields parse error
| From: | _lallous | Date: | Thu, 11 Oct 2001 13:45:01 +0000 |
| Subject: | Re: eval( ) statement yields parse error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70792@lists.php.net to get a copy of this message | ||
this will work:
"\$q[\$i+1] = '\"' . \$q[\$i+1] . '\"';"
your problem was like this:
$str = "$arr[$i+1]";
you can't do arithm. operations within a string, you can do this alone:
$str = "$arr[$i]";
"Rw" <roydallas61@nospam.hotmail.com> wrote in message
news:20011011123759.96257.qmail@pb1.pair.com...
> eval ("\$q[\$i+1] = \"$q[$i+1]\";");
>
> This yields an error:
> Parse error: parse error, expecting `']'' in /www/survdesc.php on line 60
>
> Any ideas?
>
>