<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt">Well, you don't see it in the output but I can guarantee that you're filling your logs with errors...&nbsp; I ran it without the quotes around the characters and it really sprayed out the errors.&nbsp; Note that I ran in the PHP command line, not on a web server.&nbsp; I modified the code to do the right thing.&nbsp; It doesn't make a lot of sense but here is the code that I worked out:<br><br>&lt;?PHP<br>for ($i = 'A'; $i &lt; 'Z'; $i++)<br>&nbsp; {<br>&nbsp;&nbsp; if ($i === 'N') { echo "\n\n&lt;br&gt;\n\n"; }<br><br>&nbsp;&nbsp; echo $i;<br><br>&nbsp;&nbsp; if ($i &lt;&gt; 'M' || $i &lt;&gt; 'Z') { echo " | "; }<br>&nbsp; }<br>echo "Z";<br>?&gt;<br><br><br>Hope that helps...<br><br>Cheers!<br><br>Bob<br><div>&nbsp;</div>--<br>"When once you have tasted flight, you will forever walk the earth
 with your eyes turned skyward, for there you have been, and there you will always long to return."<br>   --Leonardo da Vinci<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Rob Dege &lt;livemotion@gmail.com&gt;<br>To: nflug@nflug.org<br>Sent: Friday, April 18, 2008 12:57:12 PM<br>Subject: Re: [nflug] PHP character question<br><br>
<br>Using quotes on the characters didn't appear to have an effect on either the loop or the if condition, so I left it omitted.&nbsp; The 2nd piece of code is adding a separator in between every letter except for M and Z.&nbsp; My desired output is:<br>
<a rel="nofollow" target="_blank"  href="http://136.183.201.239/%7Edegerc/index.php?letter=A" style="text-decoration: none;"></a><br>A | B | C | D | E | F | G | H | I | J | K | L | M&nbsp; 

<br>

N | O | P | Q | R | S | T | U | V | W | X | Y | 
Z<br><br><br>Here is my overall code:<br><br><br>for ($i=A; $i&lt;Z; $i++)<br>&nbsp; {<br>&nbsp;&nbsp; if ($i === N) { echo "\n\n&lt;br&gt;\n\n"; }<br><br>&nbsp;&nbsp; echo $i;<br><br>&nbsp;&nbsp; if ($i &lt;&gt; M || $i &lt;&gt; Z) { echo " | "; }<br>
&nbsp; }<br><br><br><br><div class="gmail_quote">On Fri, Apr 18, 2008 at 12:40 PM, Robert Meyer &lt;<a rel="nofollow" ymailto="mailto:meyer_rm@yahoo.com" target="_blank" href="mailto:meyer_rm@yahoo.com">meyer_rm@yahoo.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Well, a couple of observations...&nbsp; You never quote any of the characters that you're assigning.&nbsp; I'm not sure if it's an omission or what.<br>
<br>Second, in the chunk of code with the ||, the first piece of code with give a a '|' for *every* character.&nbsp; For the second, you will get two for every character that is not M or Z and one for each M or Z.<br><br>
Maybe a cut and paste of the whole code fragment might help figure out what's going on.<br><br>Cheers!<br><br>Bob<br><div>&nbsp;</div>--<br>"When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return."<br>
   --Leonardo da Vinci<div><div></div><div class="Wj3C7c"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
----- Original Message ----<br>From: Rob Dege &lt;<a rel="nofollow" ymailto="mailto:livemotion@gmail.com" target="_blank" href="mailto:livemotion@gmail.com">livemotion@gmail.com</a>&gt;<br>To: <a rel="nofollow" ymailto="mailto:nflug@nflug.org" target="_blank" href="mailto:nflug@nflug.org">nflug@nflug.org</a><br>Sent: Friday, April 18, 2008 12:22:35 PM<br>
Subject: [nflug] PHP character question<br><br>
Hello to all,<br><br>I am trying to create a simple for loop, but instead of incrementing numbers, I want to increment characters.&nbsp; I am able to get the code to work, up until the end, when it comes time to output the last char.<br>

<br>for ($i = A; $i &lt; Z; $i++)<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; echo "$i &lt;br&gt;";<br>&nbsp;&nbsp; }<br><br>In this simple example, the output would be to echo the characters A - Y, omitting Z; which is expected.&nbsp; If I change $i &lt; Z to $i &lt;= Z, one would expect to have Z included in the output.&nbsp; Unfortunately, this does not happen.&nbsp; Instead, it continues to loop past Z until it outputs YZ (A - Z, AA - AZ, BA - BZ, ..... YA - YZ).&nbsp; This would imply that it's matching against ZA instead of just Z.&nbsp; I know there are alternate ways around this, but now I'm really curious about the looping behavior here.&nbsp; Any insight is appreciated.<br>

<br><br clear="all">I also have a related question with an if condition, if you want further head scratching.<br><br>if ($i != M || $i != Z) { echo " | "; }<br><br>With this statement, whenever $i has the value of either M or Z it should execute the condition, but it doesn't.&nbsp; However, if I separate the if condition into two separate conditions statements, it works as intended.<br>

<br>if ($i != M) { echo " | "; }<br><br>if ($i != Z) { echo " | "; }<br><br>I'm not sure why the || would cause a problem, but for some reason it does.<br><br>-- <br>-Rob<br><br>Ben Franklin Quote: "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
</div><br></div></div></div></div><div class="WgoR0d"><br>



      <hr size="1">Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile. <a rel="nofollow" target="_blank" href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ"> Try it now.</a></div></div><br>_______________________________________________<br>

nflug mailing list<br>
<a rel="nofollow" ymailto="mailto:nflug@nflug.org" target="_blank" href="mailto:nflug@nflug.org">nflug@nflug.org</a><br>
<a rel="nofollow" target="_blank" href="http://www.nflug.org/mailman/listinfo/nflug">http://www.nflug.org/mailman/listinfo/nflug</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-Rob<br><br>Ben Franklin Quote: "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
</div><br></div></div><br>

      <hr size=1>Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a></body></html>