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 )

ascii

The ASCII code

Output:

Returns the specified character.

 

For Example:

<?php
$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


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

Share This Post

Recent Articles

© 2017 Sumit Bansal. All rights reserved. Site Admin · Entries RSS · Comments RSS
Powered by WordPress · Designed by Theme Junkie