At 04:58 PM 2/12/2002 -0600, phantom wrote: >How do I get the ASCII value of a character.... increment it by one... >and convert back to a character. > >For example: > >I want to grab a char such as "C" and increment it to "D" ???
To answer your first question: <? $letter = "C"; echo $letter."<br>"; //Outputs 'C' $letter = chr(ord($letter)+1); echo $letter."<br>"; //Outputs 'D' ?> But there is an easier way to do it: <? $letter = "C"; echo $letter."<br>"; //Outputs 'C' $letter++; echo $letter."<br>"; //Outputs 'D' ?> HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php