ord

(PHP 3, PHP 4 >= 4.0.0)

ord -- Return ASCII value of character

Description

int ord (string string)

Returns the ASCII value of the first character of string. This function complements chr().

Example 1. ord() example

if (ord($str) == 10) {
    echo "The first character of \$str is a line feed.\n";
}
]>
      </programlisting>
     </example>
    </para>
    <para>
     You can find an ASCII-table over here: <ulink url="&url.asciitable;"
     >&url.asciitable;</ulink>.
    </para>
    <simpara>
     See also <function>chr</function>.
    </simpara> 
   </refsect1>
  </refentry>

  <refentry id="function.parse-str">
   <refnamediv>
    <refname>parse_str</refname>
    <refpurpose>Parses the string into variables</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>void <function>parse_str</function></funcdef>
      <paramdef>string <parameter>str</parameter></paramdef>
      <paramdef>array 
       <parameter><optional>arr</optional>
       </parameter>
      </paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     Parses <parameter>str</parameter> as if it were the query string
     passed via an URL and sets variables in the current scope. If 
     the second parameter <parameter>arr</parameter> is present, 
     variables are stored in this variable as an array elements instead. 
    </para>
    <para>
     <example>
      <title>Using <function>parse_str</function></title>
      <programlisting role="php">
<![CDATA[
$str = "first=value&second[]=this+works&second[]=another";
parse_str($str);
echo $first;     /* prints "value" */
echo $second[0]; /* prints "this works" */
echo $second[1]; /* prints "another" */



Banner.Novgorod.Ru