Find ASCII Value Of Character Using PHP

What we are going to see through this article is Find ASCII Value Of Character Using PHP. The ASCII value represents the English alphabet as numbers, meaning that each letter in the English dictionary contains a number from 0 to 127.

For example, the ASCII value for capital or uppercase A is ’65’ and the ASCII value for lowercase or lowercase a is ’97’.

Find ASCII Value Of Character Using PHP

Find ASCII Value of Character using PHP

Below, We can see the 1st sample program to do a task here.

<?php
// PHP program to illustrate the ord() function

// ASCII value of 'A' is printed.
echo ord("Apple");
?>

Output

This is a sample output for your reference will show below:

65

Read Also: Convert Array To String In PHP

Find ASCII Value of Character using PHP

<?php
// PHP program to illustrate the ord() function

// ASCII value of 'C' is printed
echo ord("Codingdiksha");
?>

Read Also: How To Convert Lowercase To Uppercase In PHP?

Read Also: How To Convert Uppercase To Lowercase In PHP?

Output

67

Conclusion

What we learned through this article is to Find ASCII Value Of Character Using PHP. Also if you have any doubts please leave a comment via the comment box. And we ask that you benefit everyone who shared this article with your friends.

Leave a Comment