This is a discussion on < in ' ' and PHP shouts about syntax error :( within the PHP Language forums, part of the PHP Programming Forums category; Hi! I`ve got a problem again:( I almoust finished my project and I was doing stupid forms in html ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi!
I`ve got a problem again:( I almoust finished my project and I was doing stupid forms in html to display as frontend. I have something like that: <?php $wyswietl[] = ' <html> blahblahblah'; and php shouts: <b>Parse error</b>: parse error, unexpected '<' in <b>D:\Incoming\WWW\etak.pl \developer_d isplay.inc</b> on line <b>3</b><br /> :(( I was sure that a variable can have >1 lines TIA for any sugestions:( -- Pozdrawiam, Maciej Nadolski |
|
|||
|
Maciej Nadolski wrote:
> Hi! > I`ve got a problem again:( > I almoust finished my project and I was doing stupid forms in html to display as > frontend. I have something like that: > <?php > $wyswietl[] = ' > <html> > blahblahblah'; > > and php shouts: > > <b>Parse error</b>: parse error, unexpected '<' in <b>D:\Incoming\WWW\etak.pl > \developer_d > isplay.inc</b> on line <b>3</b><br /> > :(( > I was sure that a variable can have >1 lines > TIA for any sugestions:( > You need heredoc syntax <?php $wyswietl[] = <<<EOT <html> blahblahblah EOT; ?> |
|
|||
|
Maciej Nadolski wrote:
> Hi! > I`ve got a problem again:( > I almoust finished my project and I was doing stupid forms in html to > display as frontend. I have something like that: > <?php > $wyswietl[] = ' > <html> > blahblahblah'; > > and php shouts: > > <b>Parse error</b>: parse error, unexpected '<' in > <b>D:\Incoming\WWW\etak.pl \developer_d > isplay.inc</b> on line <b>3</b><br /> > :(( > I was sure that a variable can have >1 lines > TIA for any sugestions:( use " instead of ' -- --- --- --- --- --- --- --- jack@croatiabiz.com |
|
|||
|
Also sprach Maciej Nadolski:
> Hi! > I`ve got a problem again:( > I almoust finished my project and I was doing stupid forms in html to > display as frontend. I have something like that: > <?php > $wyswietl[] = ' > <html> > blahblahblah'; > > and php shouts: > > <b>Parse error</b>: parse error, unexpected '<' in > <b>D:\Incoming\WWW\etak.pl \developer_d > isplay.inc</b> on line <b>3</b><br /> > :(( > I was sure that a variable can have >1 lines > TIA for any sugestions:( I tried it out, but got no parse error - your syntax above is valid. Maybe the error is somewhere else? |
|
|||
|
With total disregard for any kind of safety measures Kevin Thorpe
<kevin@pricetrak.com> leapt forth and uttered: > You need heredoc syntax > <?php > $wyswietl[] = <<<EOT > <html> > blahblahblah > EOT; > ?> > You cannot indent the end token in a heredoc, it must be placed on the first column. (corrected to demonstrate) -- There is no signature..... |