Ok, I'm sick of encapsed string error
Posted: Mon Sep 26, 2005 1:24 pm
Take a look:
Now what's wrong with that?
Code: Select all
$JSarray .= "events[". $j + 1 ."]={\n";A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$JSarray .= "events[". $j + 1 ."]={\n";Code: Select all
$JSarray .= 'events['. ++$j .']={' . "\n";Code: Select all
[feyd@home]>php -r "$j = 2; echo 'foo'.$j+1.'bar';"
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in Command line code on line 1
[feyd@home]>php -r "$j = 2; echo 'foo'.$j;//+1.'bar';"
foo2
[feyd@home]>php -r "$j = 2; echo 'foo'.$j+1;//.'bar';"
1
[feyd@home]>php -r "$j = 2; echo 'foo'.($j+1).'bar';"
foo3bar