How to use ASCII value with PHP

Character encoding is useful in web development for generating character strings from random numbers (CAPTCHA images for instance), displaying non-standard characters and many other purposes.

To use charachter encoding with PHP or To use ASCII value with PHP, we have a function to print ASCII value.

string chr ( int $ascii )


The ASCII code


Returns the specified character.


For Example:

$str = "The string ends in escape: ";
$str .= chr(27); /* add an escape character at the end of $str */
/* Often this is more useful */

$str = sprintf(“The string ends in escape: %c”, 27);

For More Info.:-  Click Here

Bansal Sumit

To seek challenging roles and to achieve excellence in the field of Open Source Web Technology with a profound spirit of commitment and dedication.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *