<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Get the "age" of the code point</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="class.intlchar.html">IntlChar</a></div> <div class="next" style="text-align: right; float: right;"><a href="intlchar.chardigitvalue.html">IntlChar::charDigitValue</a></div> <div class="up"><a href="class.intlchar.html">IntlChar</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="intlchar.charage" class="refentry"> <div class="refnamediv"> <h1 class="refname">IntlChar::charAge</h1> <p class="verinfo">(PHP 7)</p><p class="refpurpose"><span class="refname">IntlChar::charAge</span> — <span class="dc-title">Get the "age" of the code point</span></p> </div> <div class="refsect1 description" id="refsect1-intlchar.charage-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">array</span> <span class="methodname"><strong>IntlChar::charAge</strong></span> ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$codepoint</code></span> )</div> <p class="para rdfs-comment"> Gets the "age" of the code point. </p> <p class="para"> The "age" is the Unicode version when the code point was first designated (as a non-character or for Private Use) or assigned a character. This can be useful to avoid emitting code points to receiving processes that do not accept newer characters. </p> </div> <div class="refsect1 parameters" id="refsect1-intlchar.charage-parameters"> <h3 class="title">Parameters</h3> <dl> <dt> <code class="parameter">codepoint</code></dt> <dd> <p class="para">The <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> codepoint value (e.g. <em>0x2603</em> for <em class="emphasis">U+2603 SNOWMAN</em>), or the character encoded as a UTF-8 <span class="type"><a href="language.types.string.html" class="type string">string</a></span> (e.g. <em>"\u{2603}"</em>)</p> </dd> </dl> </div> <div class="refsect1 returnvalues" id="refsect1-intlchar.charage-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> The Unicode version number, as an <span class="type"><a href="language.types.array.html" class="type array">array</a></span>. For example, version <em class="emphasis">1.3.31.2</em> would be represented as <em>[1, 3, 31, 2]</em>. </p> </div> <div class="refsect1 examples" id="refsect1-intlchar.charage-examples"> <h3 class="title">Examples</h3> <div class="example" id="example-3192"> <p><strong>Example #1 Testing different code points</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">charage</span><span style="color: #007700">(</span><span style="color: #DD0000">"\u{2603}"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">charage</span><span style="color: #007700">(</span><span style="color: #DD0000">"\u{1F576}"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> 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) } </pre></div> </div> </div> </div> <div class="refsect1 seealso" id="refsect1-intlchar.charage-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><span class="function"><a href="intlchar.getunicodeversion.html" class="function" rel="rdfs-seeAlso">IntlChar::getUnicodeVersion()</a> - Get the Unicode version</span></li> <li class="member"><span class="function"><a href="intlchar.getintpropertyminvalue.html" class="function" rel="rdfs-seeAlso">IntlChar::getIntPropertyMinValue()</a> - Get the min value for a Unicode property</span></li> <li class="member"><span class="function"><a href="intlchar.getintpropertyvalue.html" class="function" rel="rdfs-seeAlso">IntlChar::getIntPropertyValue()</a> - Get the value for a Unicode property for a code point</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="class.intlchar.html">IntlChar</a></div> <div class="next" style="text-align: right; float: right;"><a href="intlchar.chardigitvalue.html">IntlChar::charDigitValue</a></div> <div class="up"><a href="class.intlchar.html">IntlChar</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>