Re: [PHP] Ascii Value
http://www.php.net/manual/en/function.ord.php Original Message Follows From: James Drabb [EMAIL PROTECTED] Hey *, In C I can cast a char 'j' to an int and get it's ascii value. Is there a funciton in PHP to do this with a string containing a single char (i.e. j)? I could write a big switch for all the chars of the alphabet, however I was hoping for a better approach? Jim Drabb -- - Never ask a geek why, just nod your head and slowly back away - James Drabb JR Programmer Analyst Darden Restaurants Business Systems [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ascii Value
The functions you want are ORD() and CHR(). Search for them in the manual. -Kevin - Original Message - From: James Drabb [EMAIL PROTECTED] To: Php-General (E-mail) [EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 12:57 PM Subject: [PHP] Ascii Value Hey *, In C I can cast a char 'j' to an int and get it's ascii value. Is there a funciton in PHP to do this with a string containing a single char (i.e. j)? I could write a big switch for all the chars of the alphabet, however I was hoping for a better approach? Jim Drabb -- - Never ask a geek why, just nod your head and slowly back away - James Drabb JR Programmer Analyst Darden Restaurants Business Systems [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ascii Value
?php $alpha = 'd'; $new = ord($alpha); echo $new; ? The name of the function is ord Pradeep Dsouza Naharonline.com - Original Message - From: James Drabb [EMAIL PROTECTED] To: Php-General (E-mail) [EMAIL PROTECTED] Sent: Wednesday, June 19, 2002 12:27 AM Subject: [PHP] Ascii Value Hey *, In C I can cast a char 'j' to an int and get it's ascii value. Is there a funciton in PHP to do this with a string containing a single char (i.e. j)? I could write a big switch for all the chars of the alphabet, however I was hoping for a better approach? Jim Drabb -- - Never ask a geek why, just nod your head and slowly back away - James Drabb JR Programmer Analyst Darden Restaurants Business Systems [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php