Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #10788
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | "J.O. Aho" <user@example.net> |
| Newsgroups | comp.lang.php |
| Subject | Re: syntax error or notepad++ error? |
| Date | Mon, 16 Sep 2013 20:40:13 +0200 |
| Lines | 47 |
| Message-ID | <b9p1kdFnpiU1@mid.individual.net> (permalink) |
| References | <zufc0c2efad9.1rt9lmbdi53xw$.dlg@40tude.net> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net Ytj5jqTWwe2YfAtoATON2gg0zXcVjcKP32nqMkku3C8kzkZ9Na |
| Cancel-Lock | sha1:wZKuO26vm+0oMsOkNseE8qyhTIE= |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130808 Thunderbird/17.0.8 |
| In-Reply-To | <zufc0c2efad9.1rt9lmbdi53xw$.dlg@40tude.net> |
| Xref | csiph.com comp.lang.php:10788 |
Show key headers only | View raw
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.'&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}&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
Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread
syntax error or notepad++ error? richard <noreply@example.com> - 2013-09-16 09:20 -0400
Re: syntax error or notepad++ error? Denis McMahon <denismfmcmahon@gmail.com> - 2013-09-16 14:10 +0000
Re: syntax error or notepad++ error? Denis McMahon <denismfmcmahon@gmail.com> - 2013-09-16 14:11 +0000
Re: syntax error or notepad++ error? Paul Herber <paul@pherber.com> - 2013-09-16 15:12 +0100
Re: syntax error or notepad++ error? richard <noreply@example.com> - 2013-09-16 10:50 -0400
Re: syntax error or notepad++ error? Jerry Stuckle <jstucklex@attglobal.net> - 2013-09-16 11:05 -0400
Re: syntax error or notepad++ error? Paul Herber <paul@pherber.com> - 2013-09-16 17:52 +0100
Re: syntax error or notepad++ error? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-09-16 17:52 +0200
Re: syntax error or notepad++ error? Jerry Stuckle <jstucklex@attglobal.net> - 2013-09-16 11:12 -0400
Re: syntax error or notepad++ error? richard <noreply@example.com> - 2013-09-16 13:14 -0400
Re: syntax error or notepad++ error? Jerry Stuckle <jstucklex@attglobal.net> - 2013-09-16 13:47 -0400
Re: syntax error or notepad++ error? richard <noreply@example.com> - 2013-09-16 11:13 -0400
Re: syntax error or notepad++ error? Christoph Michael Becker <cmbecker69@arcor.de> - 2013-09-16 17:35 +0200
Re: syntax error or notepad++ error? Jerry Stuckle <jstucklex@attglobal.net> - 2013-09-16 13:48 -0400
Re: syntax error or notepad++ error? Norman Peelman <npeelman@cfl.rr.com> - 2013-09-16 21:49 -0400
Re: syntax error or notepad++ error? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-09-17 18:48 +0200
Re: syntax error or notepad++ error? "J.O. Aho" <user@example.net> - 2013-09-16 20:40 +0200
csiph-web