string chr function - returns ascii value to it's equivalent character
string-chr-function-example-in-php.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>string chr function - returns ascii value to it's equivalent character</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Md Iqbal Hosan">
<meta name="title" content="string chr function - returns ascii value to it's equivalent character">
<meta name="keywords" content="php, example, code, array, function, chr, string">
<meta name="description" content="string chr function - returns ascii value to it's equivalent character">
<style>
h2, h4{background:#bbb; color:#000081;}
h2{ padding:3px; margin:3px; font-size:22px;}
h4{ padding:2px; margin:2px; font-size:18px;}
p{padding:2px; margin:2px; color:#3333Fb;}
body{ background:#FFFFFc;}
</style>
</head>
<body>
<h2>string chr function - returns ascii value to it's equivalent character</h2>
<pre>
<?php
/*
-----------------------------------------------------------------
let us take an ascii value to find out it's equivalent character
-----------------------------------------------------------------
*/
$asciiValue = 65;
echo "<h4>Output of asciiValue</h4>";
print "<p>$"."asciiValue = {$asciiValue}</p>";
/*
------------------------------------------------------------------------------------------
now we want to get the equivalent character of the given ascii value by using chr function
------------------------------------------------------------------------------------------
*/
$equivalentCharacter = chr($asciiValue);
echo "<h4>Output of equivalentCharacter by using string chr function</h4>";
print "<p>$"."equivalentCharacter = {$equivalentCharacter}</p>";
?>
</pre>
</body>
</html>

No comments:
Post a Comment
leave your comments here..