The ord() function calculates the ASCII value of first character of a string. This will convert the first byte of a string to a value between 0 and 255
[table caption=”” width=”100%” colwidth=”15%|15%|15%|55%” colalign=”left|lef|lef|left”]
Name, Required /Optional, Value Type, Description
string , Required, String , It is the string for which we have to get an ASCII value from
[/table]
This will returns an integer between 0 and 255 OR ASCII value as an integer
<?php echo ord("t")."<br>"; echo ord("tutor")."<br>"; ?>
See below is the output of above code in Web browser.
<?php $str = "\r"; echo ord($str)."<br>"; if (ord($str) == 13) { echo "The first character of a string is a carriage return.\n"; } ?>
See below is the output of above code in Web browser.
When it comes to children, there’s one universal truth: the right toy can spark imagination, build skills, and make memories…
In today’s digital age, where screens and gadgets dominate our children’s lives, there’s something heartwarming about a well-loved plush toy…
In a world dominated by screens and fast-paced routines, it’s easy to forget the simple magic of a toy in…
In the heart of Delhi’s vibrant streets lies a world where imagination meets innovation — the magical universe of toys.…
When was the last time a toy truly amazed you—not just as a product, but as a thoughtful tool for…
In the digital age, the way we experience childhood has changed, but the essence remains the same—imagination, exploration, and joy.…