Re: Ascii Value
| From: | Pradeep Dsouza | Date: | Wed, 19 Jun 2002 06:12:32 +0000 |
| Subject: | Re: Ascii Value | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-102873@lists.php.net to get a copy of this message | ||
<?php
$alpha = 'd';
$new = ord($alpha);
echo $new;
?>
The name of the function is ord
Pradeep Dsouza
Naharonline.com
----- Original Message -----
From: "James Drabb" <JDrabb@darden.com>
To: "Php-General (E-mail)" <php-general@lists.php.net>
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
JDrabb@Darden.com
JDrabb@cfl.rr.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php