int ord ( string str ) returns the equivalent ASCII value : ord « String « PHP






int ord ( string str ) returns the equivalent ASCII value

 
<?
    $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";
    }
?>
  
  








Related examples in the same category