[PHP-DOC] cvs: phpdoc /it/functions misc.xml From: Luca Perugini (l.perugini <email protected>)
Date: 09/18/00

perugini Mon Sep 18 08:57:51 2000 EDT

  Modified files:
    /phpdoc/it/functions misc.xml
  Log:
  Fixed some typo.
  
  
Index: phpdoc/it/functions/misc.xml
diff -u phpdoc/it/functions/misc.xml:1.5 phpdoc/it/functions/misc.xml:1.6
--- phpdoc/it/functions/misc.xml:1.5 Sun Sep 17 12:41:10 2000
+++ phpdoc/it/functions/misc.xml Mon Sep 18 08:57:51 2000
@@ -783,4 +783,189 @@
     <note>
      <simpara>
       This function is an alias for the function
- <function>highlight_file</
\ No newline at end of file
+ <function>highlight_file</function>
+ </simpara>
+ </note>
+ <simpara>
+ See also <function>highlight_string</function>,
+ <function>highlight_file</function>.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.sleep">
+ <refnamediv>
+ <refname>sleep</refname>
+ <refpurpose>Delay execution</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>void <function>sleep</function></funcdef>
+ <paramdef>int <parameter>seconds</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <simpara>
+ The sleep function delays program execution for the given number
+ of <parameter>seconds</parameter>.
+ </simpara>
+ <simpara>
+ See also <function>usleep</function>.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.uniqid">
+ <refnamediv>
+ <refname>uniqid</refname>
+ <refpurpose>Generate a unique id</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>uniqid</function></funcdef>
+ <paramdef>string <parameter>prefix</parameter></paramdef>
+ <paramdef>boolean
+ <parameter><optional>lcg</optional></parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <simpara>
+ <function>Uniqid</function> returns a prefixed unique identifier
+ based on the current time in microseconds. The prefix can be
+ useful for instance if you generate identifiers simultaneously on
+ several hosts that might happen to generate the identifier at the
+ same microsecond. <parameter>Prefix</parameter> can be up to 114
+ characters long.
+ </simpara>
+ <simpara>
+ If the optional <parameter>lcg</parameter> parameter is true,
+ <function>uniqid</function> will add additional "combined LCG"
+ entropy at the end of the return value, which should make the
+ results more unique.
+ </simpara>
+ <simpara>
+ With an empty <parameter>prefix</parameter>, the returned string
+ will be 13 characters long. If <parameter>lcg</parameter> is
+ true, it will be 23 characters.
+ </simpara>
+ <note>
+ <simpara>
+ The <parameter>lcg</parameter> parameter is only available in
+ PHP 4 and PHP 3.0.13 and later.
+ </simpara>
+ </note>
+ <para>
+ If you need a unique identifier or token and you intend to give
+ out that token to the user via the network (i.e. session cookies),
+ it is recommended that you use something along the lines of
+ <informalexample>
+ <programlisting role="php">
+$token = md5 (uniqid ("")); // no random portion
+$better_token = md5 (uniqid (rand())); // better, difficult to guess
+ </programlisting>
+ </informalexample>
+ </para>
+ <simpara>
+ This will create a 32 character identifier (a 128 bit hex number)
+ that is extremely difficult to predict.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.unpack">
+ <refnamediv>
+ <refname>unpack</refname>
+ <refpurpose>Unpack data from binary string</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>array <function>unpack</function></funcdef>
+ <paramdef>string <parameter>format</parameter></paramdef>
+ <paramdef>string <parameter>data</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>Unpack</function> from binary string into array
+ according to <parameter>format</parameter>. Returns array
+ containing unpacked elements of binary string.
+ </para>
+ <para>
+ <function>Unpack</function> works slightly different from Perl as
+ the unpacked data is stored in an associative array. To
+ accomplish this you have to name the different format codes and
+ separate them by a slash /.
+ <example>
+ <title><function>Unpack</function> format string</title>
+ <programlisting role="php">
+$array = unpack ("c2chars/nint", $binarydata);
+ </programlisting>
+ <para>
+ The resulting array will contain the entries "chars1",
+ "chars2" and "int".
+ </para>
+ </example>
+ </para>
+ <para>
+ For an explanation of the format codes see also:
+ <function>pack</function>
+ </para>
+ <para>
+ Note that PHP internally stores integral values as signed. If you
+ unpack a large unsigned long and it is of the same size as PHP
+ internally stored values the result will be a negative number
+ even though unsigned unpacking was specified.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.usleep">
+ <refnamediv>
+ <refname>usleep</refname>
+ <refpurpose>Delay execution in microseconds</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>void <function>usleep</function></funcdef>
+ <paramdef>int <parameter>micro_seconds</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <simpara>
+ The <function>usleep</function> function delays program execution
+ for the given number of <parameter>micro_seconds</parameter>.
+ </simpara>
+ <simpara>
+ See also <function>sleep</function>.
+ </simpara>
+ <note>
+ <simpara>
+ This function does not work on Windows systems.
+ </simpara>
+ </note>
+ </refsect1>
+ </refentry>
+
+ </reference>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:"../../manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->