Here is an example to how to return an ASCII value of a character in PHP. There is a predefined function ord(), which helps us to return an ASCII value of a character.
Below is an example for displaying the ASCII value of a character 'a':
<html> <body> <?php $a='a'; $b=ord($a); echo $b; ?> </body> </html>
Output: 97