Reply to Re: parse error, unexpected T_CONSTANT_ENCAPSED_STRING

Your name:

Reply:


Posted by J.O. Aho on 05/23/07 04:43

christopher.j.just@gmail.com wrote:
> On May 22, 12:18 pm, christopher.j.j...@gmail.com wrote:
>> I'm getting a parse error - parse error, unexpected
>> T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' - on this line of
>> code:
>>
>> "oFCKeditor.Value = "; echo preg_replace"(\"/\r\n/\", \"\\n\",
>> addslashes(\"" . $VAR . "\"))";
>>
>> it is part of a larger block:
>>
>> if (!empty($query_data['VAR'])) {
>> echo "<table width=\"85\" border=\"0\" cellpadding=\"0\" cellspacing=
>> \"0\">\n".
>> "<tr>
>> <td scope=\"col\">&nbsp;</td>\n".
>> "<td scope=\"col\"><b>TEXT </b></td>\n".


You use a quite messy way to echo out your data, it can be much easier if you
store result from functions into variables and then use

echo <<<EOF
<your html tags>{$values_you_want_to_inject_into_the_html}</more html tags>
EOF;

That way you can use " without any escape character before and you see things
a lot easier.
--

//Aho

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация