|
|
Tutorials » Php »
|
Topic |
What is chr function and how it is used in string ?
|
|
Explanation |
|
The chr function returns one character string containing the character specified by ascii.
Syntax:
chr(ascii)
In the above syntax "ascii" is the value for which the equivalent character is returned,
for hexadecimal and octal values can be used with leading "ox","o".
Example:
<?php
echo chr(38)."<br />";
echo chr(046)."<br />";
echo chr(0x26)."<br />";
?>
Result:
&
&
&
In the above chr function example the decimal,octal,hexadecimal values for the ASCII character "&" is provided.
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|