The
ord() string function in PHP is used to access the ASCII representation of the first character in a string. This function takes one parameter which is the string.

<?php
$char = "a";
$charCode = ord($char);
echo $charCode."<br />";
$char = "z";
$charCode = ord($char);
echo $charCode."<br />";
$char = "$";
$charCode = ord($char);
echo $charCode."<br />";
$char = "@";
$charCode = ord($char);
echo $charCode."<br />";
?>
97
122
36
64