chr

Syntax: string chr ( int $ascii ) Description: Returns a one-character string containing the character specified by ascii.

Example 1

<?php
$str="hai".chr(32)."how".chr(32)."are".chr(32)."you";
echo $str;
?>

OUTPUT

hai how are you 

Example 2

<?php
echo sprintf("1*1=%c", 49);
echo '<br/>';
echo sprintf("1*2=%c", 50);
?>

OUTPUT

1*1=1
1*2=2

 

This entry was posted in PHP and tagged .

Leave a Reply

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