PHP/String/ord

Материал из Web эксперт
Перейти к: навигация, поиск

int ord ( string str ) returns the equivalent ASCII value

   <source lang="html4strict">

<?

   $mystr = "ASCII\n";
   if (ord($mystr{1}) == 83) {
           print "The second letter in the string is S\n";
   } else {
           print "The second letter is not S\n";
   }

?>

 </source>