FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » syntax error or notepad++ error?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: syntax error or notepad++ error? [message #182826 is a reply to message #182811] Mon, 16 September 2013 18:40 Go to previous message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma:
Senior Member
On 16/09/13 15:20, richard wrote:
> All is well with matching divisions in notepad++ until I enter this code:
>
> echo "<div class='bcol2'>";
> echo "* ".$number." *<br />";
> echo '<a
> href="http://mroldies.net/index2.php?year='.$year.'&amp;nid='.$number.'">';
> echo $vid[0];
> echo "</a>";
> echo "<br />";
> echo $vid[1];
> echo "<br />";
> echo $vid[3];
> echo" </div>\n";

Gosh, this is really unreadable code, I think you should make it more
readable , it's far easier to see HTML errors if you don't use that many
echo's.


tried:

$output = <<< EOF
<div class='bcol2'>
* {$nbumber} *<br />
<a
href='http://mroldies.net/index2.php?year={$year}&amp;nid={$number}'>{$vid[0]}</a>
<br />
{$vid[1]}
<br />
{$vid[3]}
</div>
EOF;

sure your notepad++ would become a lot happier too.

To make a good code, you separate PHP functions and HTML generation as
much as possible, you don't need to echo, just end the PHP parsing with
a endtag and start it again with a starttag when you need, that is less
stressing for the system than using echo.

--

//Aho
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problem with many buttons
Next Topic: Browser fingerprinting?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 09:49:52 GMT 2024

Total time taken to generate the page: 0.03947 seconds