Tools, FAQ, Tutorials:
Converting Character to ASCII Value in PHP
How To Convert a Character to an ASCII Value?
✍: FYIcenter.com
If you want to convert characters to ASCII values, you can use the ord() function, which takes the first character of the specified string, and returns its ASCII value in decimal format. ord() complements chr(). Here is a PHP script on how to use ord():
<?php
print(ord("Hello")."\n");
print(chr(72)."\n");
?>
This script will print:
72 H
⇐ Generating Character from ASCII Value in PHP
2016-10-13, ∼4564🔥, 0💬
Popular Posts:
Where to find tutorials on EPUB file format? I want to know how to create EPUB books. Here is a larg...
How to extend json.JSONEncoder class? I want to encode other Python data types to JSON. If you encod...
How to detect errors occurred in the json_decode() call? You can use the following two functions to ...
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...
How to Build my "sleep" Docker image from the Alpine image? I want the container to sleep for 10 hou...