The IntlChar::charAge() function is an inbuilt function in PHP which is used to calculate the age of code point. Where the age is Unicode version when the code point was first designated or assigned a character. This can be useful to avoid emitting code points to receiving processes that do not accept newer characters.
Syntax:
array IntlChar::charAge( $codepoint )
Parameters: This function accepts a single parameter $codepoint which is mandotary. The input parameter is a character or integer value, which is encoded as a UTF-8 string.
Return Value: In true cases the $codepoint return the Unicode version number of an array.
Below programs illustrate the IntlChar::charAge() function in PHP.
Program 1:
<?php // PHP code to illustrate IntlChar::charAge() // function // Input int codepoint value var_dump(IntlChar::charage("\u{2025}")); echo "<br>"; // Input character codepoint value var_dump(IntlChar::charage("\u{1F878}")); echo "<br>"; // Input int codepoint value var_dump(IntlChar::charage("\u20")); echo "<br>"; // Input character codepoint value var_dump(IntlChar::charage("Geeks")); echo "<br>"; ?> |
Output:
array(4) { [0]=> int(1) [1]=> int(1) [2]=> int(0) [3]=> int(0) }
array(4) { [0]=> int(7) [1]=> int(0) [2]=> int(0) [3]=> int(0) }
NULL
NULL
Program 2:
<?php // PHP code to illustrate IntlChar::charAge() // Declare an array $arr $arr = array("^", "2345", "6", "\n"); // Loop run for every array element foreach ($arr as $val){ // Check each element as code point data var_dump(IntlChar::charage($val)); echo "<br>"; } ?> |
Output:
array(4) { [0]=> int(1) [1]=> int(1) [2]=> int(0) [3]=> int(0) }
NULL
array(4) { [0]=> int(1) [1]=> int(1) [2]=> int(0) [3]=> int(0) }
array(4) { [0]=> int(1) [1]=> int(1) [2]=> int(0) [3]=> int(0) }
Related Articles:
- IntlChar::isalpha() Function
- IntlChar::isbase() Function
- IntlChar::isblank() Function
- IntlChar::iscntrl() Function
Reference: http://php.net/manual/en/intlchar.charage.php
Recommended Posts:
- How to get the function name inside a function in PHP ?
- PHP 5 vs PHP 7
- PHP | Get PHP configuration information using phpinfo()
- PHP | php.ini File Configuration
- How to import config.php file in a PHP script ?
- PHP | imagecreatetruecolor() Function
- PHP | fpassthru( ) Function
- PHP | ImagickDraw getTextAlignment() Function
- PHP | Ds\Sequence last() Function
- PHP | Imagick floodFillPaintImage() Function
- Function to escape regex patterns before applied in PHP
- PHP | array_udiff_uassoc() Function
- PHP | geoip_continent_code_by_name() Function
- PHP | GmagickPixel setcolor() function
- PHP | opendir() Function
- PHP | cal_to_jd() Function
- PHP | stream_get_transports() Function
- PHP | Ds\Deque pop() Function
- PHP | SimpleXMLElement children() Function
- PHP | array_intersect_ukey() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : arorakashish0911

