• PHP Video Tutorials

PHP - Function Ord



Syntax

int ord ( string $string )

Definition and Usage

It returns ASCII Value of character

Return Values

It returns the ASCII value as an integer.

Parameters

Sr.No Parameters & Description
1

string

It is a character set

Example

Try out the following example

<?php
   echo ord("hi")."<br>";
?>

This will produce following result −

104
php_function_reference.htm
Advertisements