Table of Contents

Syntax

int ord(string $text)

(PHP 4, PHP 5)

$text The source string to read.
RETURNS The ASCII character code (as an integer) for the first character of $text.

What it Does

This function interprets the ASCII character code for the first character of the source string ($text) and returns this as an integer.

Example

// Get the ASCII Code for the letter 'A'
$code = ord('Awesome!');
echo 'ASCII Code: '.$code;
 
ord.txt · Last modified: 2011/02/16 13:06 by orvado
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki