[nflug] PHP character question
Rob Dege
livemotion at gmail.com
Fri Apr 18 14:36:47 EDT 2008
I'll admit, I didn't bother to check the apache logs. I usually do that
when the code fails to load, or when I'm at the stage of error correction.
Wrapping the chars in quotes did eliminate all of the notices that php
generated.
In your code example, eliminating the generation of the Z character from the
for loop will also simplify the if condition, since it removes the || bug
that I've been experiencing. So having:
if ($i != 'M') { echo " | "; }
yields the same results.
I've tweaked the code a lil bit, and now it works as it should.
Unfortunately, it feels dirty and inefficient, since there are cleaner ways
to generate the output:
// AA follows Z
for ($i='A'; $i != 'AA'; $i++)
{
if ($i === 'N') { echo "\n\n<br>\n\n"; }
echo $i;
//And in this example, the || works.
if ($i === 'M' || $i === 'Z') { echo " "; }
else { echo " | "; }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nflug.org/pipermail/nflug/attachments/20080418/f18649b1/attachment-0001.html
More information about the nflug
mailing list