cvs: /phpdoc/functions array.sgml datetime.sgml info.sgml misc.sgml url.sgml zlib.sgml

From: Date: Mon, 06 Sep 1999 03:22:00 +0000
Subject: cvs: /phpdoc/functions array.sgml datetime.sgml info.sgml misc.sgml url.sgml zlib.sgml
Groups: php.dev 
Request: Send a blank email to php-dev+get-10594@lists.php.net to get a copy of this message
coar Sun Sep 5 23:22:00 1999 EDT Modified files: /phpdoc/functions array.sgml datetime.sgml info.sgml misc.sgml url.sgml zlib.sgml Log: Alphabetically order some more functions.. Index: phpdoc/functions/array.sgml diff -u phpdoc/functions/array.sgml:1.18 phpdoc/functions/array.sgml:1.19 --- phpdoc/functions/array.sgml:1.18 Sat Aug 14 12:47:11 1999 +++ phpdoc/functions/array.sgml Sun Sep 5 23:21:59 1999 @@ -48,48 +48,32 @@ </refsect1> </refentry> - <refentry id="function.array-push"> + <refentry id="function.array-keys"> <refnamediv> - <refname>array_push</refname> - <refpurpose>Push one or more elements onto the end of array</refpurpose> + <refname>array_keys</refname> + <refpurpose>Return all the keys of an array</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> - <funcdef>int <function>array_push</function></funcdef> - <paramdef>array <parameter>array</parameter></paramdef> - <paramdef>mixed <parameter>var</parameter></paramdef> - <paramdef><parameter><optional>...</optional></parameter></paramdef> + <funcdef>array <function>array_keys</function></funcdef> + <paramdef>array <parameter>input</parameter></paramdef> </funcsynopsis> - <para> - <function>array_push</function> treats - <parameter>array</parameter> as a stack, and pushes the passed - variables onto the end of <parameter>array</parameter>. The - length of <parameter>array</parameter> increases by the number of - variables pushed. Has the same effect as: - <programlisting> -$array[] = $var; - </programlisting> - repeated for each <parameter>var</parameter>. - <para> - Returns the new number of elements in the array. + <function>array_keys</function> returns all the keys, numeric and string, from the <parameter>input</parameter> array. <para> <example> - <title><function>array_push</function> example</title> + <title><function>array_keys</function> example</title> <programlisting> -$stack = array(1, 2); -array_push($stack, "+", 3); +$array = array(0 => 100, "color" => "red"); +array_keys($array); // returns array(0, "color") </programlisting> </example> - This example would result in $stack having 4 elements: 1, 2, "+", and 3. <para> - See also <function>array_pop</function>, - <function>array_shift</function>, and - <function>array_unshift</function>. + See also <function>array_values</function>. <note> <para> @@ -98,6 +82,49 @@ </refsect1> </refentry> + <refentry id="function.array-merge"> + <refnamediv> + <refname>array_merge</refname> + <refpurpose>Merge two or more arrays</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>array <function>array_merge</function></funcdef> + <paramdef>array <parameter>array1</parameter></paramdef> + <paramdef>array <parameter>array2</parameter></paramdef> + <paramdef> + <parameter><optional> ...</optional></parameter> + </paramdef> + </funcsynopsis> + + <para> + <function>array_merge</function> merges the elements of two or + more arrays together so that the values of one are appended to + the end of the previous one. It returns the resulting array. + + <para> + If the input arrays had the same string keys, then the later value for that key will overwrite previous one. If, however, the arrays have the same numeric key, this does not happen since the values are appended. + + <para> + <example> + <title><function>array_merge</function> example</title> + <programlisting> +$array1 = array("color" => "red", 2, 4); +$array2 = array("a", "b", "color" => "green", "shape" => "trapezoid"); +array_merge($array1, $array2); + </programlisting> + <para> + Resulting array will be array("color" => "green", 2, 4, "a", "b", "shape" => "trapezoid"). + </example> + + <note> + <para> + This function was added in PHP 4.0. + </note> + </refsect1> + </refentry> + <refentry id="function.array-pop"> <refnamediv> <refname>array_pop</refname> @@ -139,48 +166,48 @@ </refsect1> </refentry> - <refentry id="function.array-unshift"> + <refentry id="function.array-push"> <refnamediv> - <refname>array_unshift</refname> - <refpurpose>Push one or more elements - onto the beginning of array</refpurpose> + <refname>array_push</refname> + <refpurpose>Push one or more elements onto the end of array</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> - <funcprototype> - <funcdef>int <function>array_unshift</function></funcdef> - <paramdef>array <parameter>array</parameter></paramdef> - <paramdef>mixed <parameter>var</parameter></paramdef> - <paramdef><parameter><optional>...</optional></parameter></paramdef> - </funcprototype> + <funcdef>int <function>array_push</function></funcdef> + <paramdef>array <parameter>array</parameter></paramdef> + <paramdef>mixed <parameter>var</parameter></paramdef> + <paramdef><parameter><optional>...</optional></parameter></paramdef> </funcsynopsis> <para> - <function>array_unshift</function> prepends passed elements to - the front of the <parameter>array</parameter>. Note that the list - of elements is prepended as a whole, so that the prepended - elements stay in the same order. + <function>array_push</function> treats + <parameter>array</parameter> as a stack, and pushes the passed + variables onto the end of <parameter>array</parameter>. The + length of <parameter>array</parameter> increases by the number of + variables pushed. Has the same effect as: + <programlisting> +$array[] = $var; + </programlisting> + repeated for each <parameter>var</parameter>. <para> - Returns the new number of elements in the - <parameter>array</parameter>. + Returns the new number of elements in the array. <para> <example> - <title><function>array_unshift</function> example</title> + <title><function>array_push</function> example</title> <programlisting> -$queue = array("p1", "p3"); -array_unshift($queue, "p4", "p5", "p6"); +$stack = array(1, 2); +array_push($stack, "+", 3); </programlisting> </example> - This would result in $queue having 5 elements: "p4", "p5", "p6", - "p1", and "p3". + This example would result in $stack having 4 elements: 1, 2, "+", and 3. <para> - See also <function>array_shift</function>, - <function>array_push</function>, and - <function>array_pop</function>. + See also <function>array_pop</function>, + <function>array_shift</function>, and + <function>array_unshift</function>. <note> <para> @@ -377,75 +404,48 @@ </refsect1> </refentry> - <refentry id="function.array-merge"> + <refentry id="function.array-unshift"> <refnamediv> - <refname>array_merge</refname> - <refpurpose>Merge two or more arrays</refpurpose> + <refname>array_unshift</refname> + <refpurpose>Push one or more elements + onto the beginning of array</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> - <funcdef>array <function>array_merge</function></funcdef> - <paramdef>array <parameter>array1</parameter></paramdef> - <paramdef>array <parameter>array2</parameter></paramdef> - <paramdef> - <parameter><optional> ...</optional></parameter> - </paramdef> + <funcprototype> + <funcdef>int <function>array_unshift</function></funcdef> + <paramdef>array <parameter>array</parameter></paramdef> + <paramdef>mixed <parameter>var</parameter></paramdef> + <paramdef><parameter><optional>...</optional></parameter></paramdef> + </funcprototype> </funcsynopsis> <para> - <function>array_merge</function> merges the elements of two or - more arrays together so that the values of one are appended to - the end of the previous one. It returns the resulting array. - - <para> - If the input arrays had the same string keys, then the later value for that key will overwrite previous one. If, however, the arrays have the same numeric key, this does not happen since the values are appended. - - <para> - <example> - <title><function>array_merge</function> example</title> - <programlisting> -$array1 = array("color" => "red", 2, 4); -$array2 = array("a", "b", "color" => "green", "shape" => "trapezoid"); -array_merge($array1, $array2); - </programlisting> - <para> - Resulting array will be array("color" => "green", 2, 4, "a", "b", "shape" => "trapezoid"). - </example> - - <note> - <para> - This function was added in PHP 4.0. - </note> - </refsect1> - </refentry> - - <refentry id="function.array-keys"> - <refnamediv> - <refname>array_keys</refname> - <refpurpose>Return all the keys of an array</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcdef>array <function>array_keys</function></funcdef> - <paramdef>array <parameter>input</parameter></paramdef> - </funcsynopsis> + <function>array_unshift</function> prepends passed elements to + the front of the <parameter>array</parameter>. Note that the list + of elements is prepended as a whole, so that the prepended + elements stay in the same order. <para> - <function>array_keys</function> returns all the keys, numeric and string, from the <parameter>input</parameter> array. + Returns the new number of elements in the + <parameter>array</parameter>. <para> <example> - <title><function>array_keys</function> example</title> + <title><function>array_unshift</function> example</title> <programlisting> -$array = array(0 => 100, "color" => "red"); -array_keys($array); // returns array(0, "color") +$queue = array("p1", "p3"); +array_unshift($queue, "p4", "p5", "p6"); </programlisting> </example> + This would result in $queue having 5 elements: "p4", "p5", "p6", + "p1", and "p3". <para> - See also <function>array_values</function>. + See also <function>array_shift</function>, + <function>array_push</function>, and + <function>array_pop</function>. <note> <para> Index: phpdoc/functions/datetime.sgml diff -u phpdoc/functions/datetime.sgml:1.11 phpdoc/functions/datetime.sgml:1.12 --- phpdoc/functions/datetime.sgml:1.11 Mon Aug 9 18:11:40 1999 +++ phpdoc/functions/datetime.sgml Sun Sep 5 23:22:00 1999 @@ -127,108 +127,6 @@ </refentry> - <refentry id="function.strftime"> - <refnamediv> - <refname>strftime</refname> - <refpurpose>format a local time/date according to locale settings - </refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcdef>string <function>strftime</function></funcdef> - <paramdef>string <parameter>format</parameter></paramdef> - <paramdef>int <parameter>timestamp</parameter></paramdef> - </funcsynopsis> - <para> - Returns a string formatted according to the given format string - using the given <parameter>timestamp</parameter> or the current - local time if no timestamp is given. Month and weekday names - and other language dependent strings respect the current locale - set with <function>setlocale</function>. - - <para> - The following conversion specifiers are recognized in the format string: - <itemizedlist> - <listitem><simpara>%a - abbreviated weekday name according to the current locale</simpara></listitem> - <listitem><simpara>%A - full weekday name according to the current locale</simpara></listitem> - <listitem><simpara>%b - abbreviated month name according to the current locale</simpara></listitem> - <listitem><simpara>%B - full month name according to the current locale</simpara></listitem> - <listitem><simpara>%c - preferred date and time representation for the current locale</simpara></listitem> - <listitem><simpara>%d - day of the month as a decimal number (range 00 to 31)</simpara></listitem> - <listitem><simpara>%H - hour as a decimal number using a 24-hour clock (range 00 to 23)</simpara></listitem> - <listitem><simpara>%I - hour as a decimal number using a 12-hour clock (range 01 to 12)</simpara></listitem> - <listitem><simpara>%j - day of the year as a decimal number (range 001 to 366)</simpara></listitem> - <listitem><simpara>%m - month as a decimal number (range 1 to 12)</simpara></listitem> - <listitem><simpara>%M - minute as a decimal number</simpara></listitem> - <listitem><simpara>%p - either am' or pm' according to the given time value, or the corresponding strings for the current locale</simpara></listitem> - <listitem><simpara>%S - second as a decimal number</simpara></listitem> - <listitem><simpara>%U - week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week</simpara></listitem> - <listitem><simpara>%W - week number of the current year as a decimal number, starting with the first Monday as the first day of the first week</simpara></listitem> - <listitem><simpara>%w - day of the week as a decimal, Sunday being 0</simpara></listitem> - <listitem><simpara>%x - preferred date representation for the current locale without the time</simpara></listitem> - <listitem><simpara>%X - preferred time representation for the current locale without the date</simpara></listitem> - <listitem><simpara>%y - year as a decimal number without a century (range 00 to 99)</simpara></listitem> - <listitem><simpara>%Y - year as a decimal number including the century</simpara></listitem> - <listitem><simpara>%Z - time zone or name or abbreviation</simpara></listitem> - <listitem><simpara>%% - a literal `%' character</simpara></listitem> - </itemizedlist> - - <example> - <title><function>strftime</function> example</title> - <programlisting role="php"> -setlocale ("LC_TIME", "C"); -print(strftime("%A in Finnish is ")); -setlocale ("LC_TIME", "fi_FI"); -print(strftime("%A, in French ")); -setlocale ("LC_TIME", "fr_CA"); -print(strftime("%A and in German ")); -setlocale ("LC_TIME", "de_DE"); -print(strftime("%A.\n")); - </programlisting> - </example> - This example works if you have the respective locales installed - in your system. - - <para> - See also <function>setlocale</function> and - <function>mktime</function>. - </para> - </refsect1> - </refentry> - - <refentry id="function.gmstrftime"> - <refnamediv> - <refname>gmstrftime</refname> - <refpurpose>format a GMT/CUT time/date according to locale settings</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcdef>string <function>gmstrftime</function></funcdef> - <paramdef>string <parameter>format</parameter></paramdef> - <paramdef>int <parameter>timestamp</parameter></paramdef> - </funcsynopsis> - <para> - Behaves the same as <function>strftime</function> except that the - time returned is Greenwich Mean Time (GMT). For example, when run - in Eastern Standard Time (GMT -0500), the first line below prints - "Dec 31 1998 20:00:00", while the second prints "Jan 01 1999 01:00:00". - <example> - <title><function>gmstrftime</function> example</title> - <programlisting role="php"> -setlocale ('LC_TIME','en_US'); -echo strftime ("%b %d %Y %H:%M:%S",mktime(20,0,0,12,31,98))."\n"; -echo gmstrftime ("%b %d %Y %H:%M:%S",mktime(20,0,0,12,31,98))."\n"; - </programlisting> - </example> - </para> - <para> - See also <function>strftime</function>. - </para> - </refsect1> - </refentry> - <refentry id="function.getdate"> <refnamediv> <refname>getdate</refname> @@ -319,6 +217,86 @@ </refentry> + <refentry id="function.gmmktime"> + <refnamediv> + <refname>gmmktime</refname> + <refpurpose>get UNIX timestamp for a GMT date</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>int <function>gmmktime</function></funcdef> + <paramdef>int <parameter>hour</parameter></paramdef> + <paramdef>int <parameter>minute</parameter></paramdef> + <paramdef>int <parameter>second</parameter></paramdef> + <paramdef>int <parameter>month</parameter></paramdef> + <paramdef>int <parameter>day</parameter></paramdef> + <paramdef>int <parameter>year</parameter></paramdef> + <paramdef>int <parameter><optional>is_dst</optional></parameter></paramdef> + </funcsynopsis> + <para> + Identical to <function>mktime</function> except the passed parameters + represents a GMT date. + </para> + </refsect1> + </refentry> + + <refentry id="function.gmstrftime"> + <refnamediv> + <refname>gmstrftime</refname> + <refpurpose>format a GMT/CUT time/date according to locale settings</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>string <function>gmstrftime</function></funcdef> + <paramdef>string <parameter>format</parameter></paramdef> + <paramdef>int <parameter>timestamp</parameter></paramdef> + </funcsynopsis> + <para> + Behaves the same as <function>strftime</function> except that the + time returned is Greenwich Mean Time (GMT). For example, when run + in Eastern Standard Time (GMT -0500), the first line below prints + "Dec 31 1998 20:00:00", while the second prints "Jan 01 1999 01:00:00". + <example> + <title><function>gmstrftime</function> example</title> + <programlisting role="php"> +setlocale ('LC_TIME','en_US'); +echo strftime ("%b %d %Y %H:%M:%S",mktime(20,0,0,12,31,98))."\n"; +echo gmstrftime ("%b %d %Y %H:%M:%S",mktime(20,0,0,12,31,98))."\n"; + </programlisting> + </example> + </para> + <para> + See also <function>strftime</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.microtime"> + <refnamediv> + <refname>microtime</refname> + <refpurpose>return current UNIX timestamp with microseconds</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>string <function>microtime</function></funcdef> + <void> + </funcsynopsis> + <para> + Returns the string "msec sec" where sec is the current time + measured in the number of seconds since the Unix Epoch (0:00:00 + January 1, 1970 GMT), and msec is the microseconds part. This + function is only available on operating systems that support the + gettimeofday() system call. + </para> + <para> + See also <function>time</function>. + </para> + </refsect1> + </refentry> + <refentry id="function.mktime"> <refnamediv> <refname>mktime</refname> @@ -381,26 +359,72 @@ </refsect1> </refentry> - <refentry id="function.gmmktime"> + <refentry id="function.strftime"> <refnamediv> - <refname>gmmktime</refname> - <refpurpose>get UNIX timestamp for a GMT date</refpurpose> + <refname>strftime</refname> + <refpurpose>format a local time/date according to locale settings + </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> - <funcdef>int <function>gmmktime</function></funcdef> - <paramdef>int <parameter>hour</parameter></paramdef> - <paramdef>int <parameter>minute</parameter></paramdef> - <paramdef>int <parameter>second</parameter></paramdef> - <paramdef>int <parameter>month</parameter></paramdef> - <paramdef>int <parameter>day</parameter></paramdef> - <paramdef>int <parameter>year</parameter></paramdef> - <paramdef>int <parameter><optional>is_dst</optional></parameter></paramdef> + <funcdef>string <function>strftime</function></funcdef> + <paramdef>string <parameter>format</parameter></paramdef> + <paramdef>int <parameter>timestamp</parameter></paramdef> </funcsynopsis> <para> - Identical to <function>mktime</function> except the passed parameters - represents a GMT date. + Returns a string formatted according to the given format string + using the given <parameter>timestamp</parameter> or the current + local time if no timestamp is given. Month and weekday names + and other language dependent strings respect the current locale + set with <function>setlocale</function>. + + <para> + The following conversion specifiers are recognized in the format string: + <itemizedlist> + <listitem><simpara>%a - abbreviated weekday name according to the current locale</simpara></listitem> + <listitem><simpara>%A - full weekday name according to the current locale</simpara></listitem> + <listitem><simpara>%b - abbreviated month name according to the current locale</simpara></listitem> + <listitem><simpara>%B - full month name according to the current locale</simpara></listitem> + <listitem><simpara>%c - preferred date and time representation for the current locale</simpara></listitem> + <listitem><simpara>%d - day of the month as a decimal number (range 00 to 31)</simpara></listitem> + <listitem><simpara>%H - hour as a decimal number using a 24-hour clock (range 00 to 23)</simpara></listitem> + <listitem><simpara>%I - hour as a decimal number using a 12-hour clock (range 01 to 12)</simpara></listitem> + <listitem><simpara>%j - day of the year as a decimal number (range 001 to 366)</simpara></listitem> + <listitem><simpara>%m - month as a decimal number (range 1 to 12)</simpara></listitem> + <listitem><simpara>%M - minute as a decimal number</simpara></listitem> + <listitem><simpara>%p - either am' or pm' according to the given time value, or the corresponding strings for the current locale</simpara></listitem> + <listitem><simpara>%S - second as a decimal number</simpara></listitem> + <listitem><simpara>%U - week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week</simpara></listitem> + <listitem><simpara>%W - week number of the current year as a decimal number, starting with the first Monday as the first day of the first week</simpara></listitem> + <listitem><simpara>%w - day of the week as a decimal, Sunday being 0</simpara></listitem> + <listitem><simpara>%x - preferred date representation for the current locale without the time</simpara></listitem> + <listitem><simpara>%X - preferred time representation for the current locale without the date</simpara></listitem> + <listitem><simpara>%y - year as a decimal number without a century (range 00 to 99)</simpara></listitem> + <listitem><simpara>%Y - year as a decimal number including the century</simpara></listitem> + <listitem><simpara>%Z - time zone or name or abbreviation</simpara></listitem> + <listitem><simpara>%% - a literal `%' character</simpara></listitem> + </itemizedlist> + + <example> + <title><function>strftime</function> example</title> + <programlisting role="php"> +setlocale ("LC_TIME", "C"); +print(strftime("%A in Finnish is ")); +setlocale ("LC_TIME", "fi_FI"); +print(strftime("%A, in French ")); +setlocale ("LC_TIME", "fr_CA"); +print(strftime("%A and in German ")); +setlocale ("LC_TIME", "de_DE"); +print(strftime("%A.\n")); + </programlisting> + </example> + This example works if you have the respective locales installed + in your system. + + <para> + See also <function>setlocale</function> and + <function>mktime</function>. </para> </refsect1> </refentry> @@ -421,30 +445,6 @@ the Unix Epoch (January 1 1970 00:00:00 GMT). </para><para> See also <function>date</function>. - </para> - </refsect1> - </refentry> - - <refentry id="function.microtime"> - <refnamediv> - <refname>microtime</refname> - <refpurpose>return current UNIX timestamp with microseconds</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcdef>string <function>microtime</function></funcdef> - <void> - </funcsynopsis> - <para> - Returns the string "msec sec" where sec is the current time - measured in the number of seconds since the Unix Epoch (0:00:00 - January 1, 1970 GMT), and msec is the microseconds part. This - function is only available on operating systems that support the - gettimeofday() system call. - </para> - <para> - See also <function>time</function>. </para> </refsect1> </refentry> Index: phpdoc/functions/info.sgml diff -u phpdoc/functions/info.sgml:1.5 phpdoc/functions/info.sgml:1.6 --- phpdoc/functions/info.sgml:1.5 Sat Jul 31 21:23:47 1999 +++ phpdoc/functions/info.sgml Sun Sep 5 23:22:00 1999 @@ -151,6 +151,31 @@ </refsect1> </refentry> + <refentry id="function.extension-loaded"> + <refnamediv> + <refname>extension_loaded</refname> + <refpurpose>find out whether an extension is loaded</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>bool <function>extension_loaded</function></funcdef> + <paramdef>string <parameter>name</parameter></paramdef> + </funcsynopsis> + <simpara> + Returns true if the extension identified by <parameter>name</parameter> + is loaded. You can see the names of various extensions by using + <function>phpinfo</function>. + <para> + See also <function>phpinfo</function>. + <note> + <para> + This function was added in 3.0.10. + </note> + + </refsect1> + </refentry> + <refentry id="function.getenv"> <refnamediv> <refname>getenv</refname> @@ -236,7 +261,7 @@ </refsect1> </refentry> - <refentry id="function.get-magic-quotes-gpc"> + <refentry id="function.get-magic-quotes-gpc"> <refnamediv> <refname>get_magic_quotes_gpc</refname> <refpurpose>Get the current active configuration setting of magic quotes gpc.</refpurpose> @@ -480,31 +505,6 @@ <para> See also <function>phpinfo</function>. - - </refsect1> - </refentry> - - <refentry id="function.extension-loaded"> - <refnamediv> - <refname>extension_loaded</refname> - <refpurpose>find out whether an extension is loaded</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcdef>bool <function>extension_loaded</function></funcdef> - <paramdef>string <parameter>name</parameter></paramdef> - </funcsynopsis> - <simpara> - Returns true if the extension identified by <parameter>name</parameter> - is loaded. You can see the names of various extensions by using - <function>phpinfo</function>. - <para> - See also <function>phpinfo</function>. - <note> - <para> - This function was added in 3.0.10. - </note> </refsect1> </refentry> Index: phpdoc/functions/misc.sgml diff -u phpdoc/functions/misc.sgml:1.5 phpdoc/functions/misc.sgml:1.6 --- phpdoc/functions/misc.sgml:1.5 Tue Aug 31 13:55:42 1999 +++ phpdoc/functions/misc.sgml Sun Sep 5 23:22:00 1999 @@ -69,6 +69,34 @@ </refsect1> </refentry> + <refentry id="function.die"> + <refnamediv> + <refname>die</refname> + <refpurpose>Output a message and terminate the current script</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>void <function>die</function></funcdef> + <paramdef>string <parameter>message</parameter></paramdef> + </funcsynopsis> + <simpara> + This language construct outputs a message and terminates parsing + of the script. It does not return. + <para> + <example> + <title>die example</title> + <programlisting> +&lt;?php +$filename = '/path/to/data-file'; +$file = fopen($filename, 'r') + or die "unable to open file ($filename)"; +?&gt; + </programlisting> + </example> + </refsect1> + </refentry> + <refentry id="function.eval"> <refnamediv> <refname>eval</refname> @@ -125,34 +153,6 @@ </refsect1> </refentry> - <refentry id="function.die"> - <refnamediv> - <refname>die</refname> - <refpurpose>Output a message and terminate the current script</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcdef>void <function>die</function></funcdef> - <paramdef>string <parameter>message</parameter></paramdef> - </funcsynopsis> - <simpara> - This language construct outputs a message and terminates parsing - of the script. It does not return. - <para> - <example> - <title>die example</title> - <programlisting> -&lt;?php -$filename = '/path/to/data-file'; -$file = fopen($filename, 'r') - or die "unable to open file ($filename)"; -?&gt; - </programlisting> - </example> - </refsect1> - </refentry> - <refentry id="function.exit"> <refnamediv> <refname>exit</refname> @@ -422,6 +422,51 @@ </refsect1> </refentry> + <refentry id="function.uniqid"> + <refnamediv> + <refname>uniqid</refname> + <refpurpose>generate a unique id</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>int <function>uniqid</function></funcdef> + <paramdef>string <parameter>prefix</parameter></paramdef> + <paramdef>boolean <parameter><optional>lcg</optional></parameter></paramdef> + </funcsynopsis> + <simpara> + <function>uniqid</function> returns a prefixed unique identifier + based on 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> + Without an empty prefix, the returned string will be 13 + characters long. If <parameter>lcg</parameter> is true, it will + be 23 characters. + </simpara> + <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> +$token = md5(uniqid("")); // no random portion +$better_token = md5(uniqid(rand())); // better, difficult to guess +</programlisting></informalexample> + <simpara> + This will create a 32 character identifier (a 128 bit hex number) + that is extremely difficult to predict. + </refsect1> + </refentry> + <refentry id="function.unpack"> <refnamediv> <refname>unpack</refname> @@ -510,51 +555,6 @@ } </programlisting> </example> - </refsect1> - </refentry> - - <refentry id="function.uniqid"> - <refnamediv> - <refname>uniqid</refname> - <refpurpose>generate a unique id</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcdef>int <function>uniqid</function></funcdef> - <paramdef>string <parameter>prefix</parameter></paramdef> - <paramdef>boolean <parameter><optional>lcg</optional></parameter></paramdef> - </funcsynopsis> - <simpara> - <function>uniqid</function> returns a prefixed unique identifier - based on 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> - Without an empty prefix, the returned string will be 13 - characters long. If <parameter>lcg</parameter> is true, it will - be 23 characters. - </simpara> - <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> -$token = md5(uniqid("")); // no random portion -$better_token = md5(uniqid(rand())); // better, difficult to guess -</programlisting></informalexample> - <simpara> - This will create a 32 character identifier (a 128 bit hex number) - that is extremely difficult to predict. </refsect1> </refentry> Index: phpdoc/functions/url.sgml diff -u phpdoc/functions/url.sgml:1.2 phpdoc/functions/url.sgml:1.3 --- phpdoc/functions/url.sgml:1.2 Thu Aug 26 18:57:28 1999 +++ phpdoc/functions/url.sgml Sun Sep 5 23:22:00 1999 @@ -3,6 +3,60 @@ <title>URL functions</title> <titleabbrev>URLs</titleabbrev> + <refentry id="function.base64-decode"> + <refnamediv> + <refname>base64_decode</refname> + <refpurpose>decodes data encoded with MIME base64</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>string <function>base64_decode</function></funcdef> + <paramdef>string <parameter>encoded_data</parameter></paramdef> + </funcsynopsis> + <para> + <function>base64_decode</function> decodes + <parameter>encoded_data</parameter> and returns the original + data. The returned data may be binary. + + <para> + See also: + <function>base64_encode</function>, + RFC-2045 section 6.8. + + </refsect1> + </refentry> + + <refentry id="function.base64-encode"> + <refnamediv> + <refname>base64_encode</refname> + <refpurpose>encodes data with MIME base64</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>string <function>base64_encode</function></funcdef> + <paramdef>string <parameter>data</parameter></paramdef> + </funcsynopsis> + <para> + <function>base64_encode</function> returns + <parameter>data</parameter> encoded with base64. This encoding + is designed to make binary data survive transport through + transport layers that are not 8-bit clean, such as mail bodies. + + <para> + Base64-encoded data takes about 33% more space than the original + data. + + <para> + See also: + <function>base64_decode</function>, + <function>chunk_split</function>, + RFC-2045 section 6.8. + + </refsect1> + </refentry> + <refentry id="function.parse-url"> <refnamediv> <refname>parse_url</refname> @@ -93,61 +147,6 @@ </refsect1> </refentry> - - <refentry id="function.base64-encode"> - <refnamediv> - <refname>base64_encode</refname> - <refpurpose>encodes data with MIME base64</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcdef>string <function>base64_encode</function></funcdef> - <paramdef>string <parameter>data</parameter></paramdef> - </funcsynopsis> - <para> - <function>base64_encode</function> returns - <parameter>data</parameter> encoded with base64. This encoding - is designed to make binary data survive transport through - transport layers that are not 8-bit clean, such as mail bodies. - - <para> - Base64-encoded data takes about 33% more space than the original - data. - - <para> - See also: - <function>base64_decode</function>, - <function>chunk_split</function>, - RFC-2045 section 6.8. - - </refsect1> - </refentry> - - - <refentry id="function.base64-decode"> - <refnamediv> - <refname>base64_decode</refname> - <refpurpose>decodes data encoded with MIME base64</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcdef>string <function>base64_decode</function></funcdef> - <paramdef>string <parameter>encoded_data</parameter></paramdef> - </funcsynopsis> - <para> - <function>base64_decode</function> decodes - <parameter>encoded_data</parameter> and returns the original - data. The returned data may be binary. - - <para> - See also: - <function>base64_encode</function>, - RFC-2045 section 6.8. - - </refsect1> - </refentry> </reference> Index: phpdoc/functions/zlib.sgml diff -u phpdoc/functions/zlib.sgml:1.2 phpdoc/functions/zlib.sgml:1.3 --- phpdoc/functions/zlib.sgml:1.2 Sat Jun 19 23:04:56 1999 +++ phpdoc/functions/zlib.sgml Sun Sep 5 23:22:00 1999 @@ -381,40 +381,6 @@ </refsect1> </refentry> - <refentry id="function.readgzfile"> - <refnamediv> - <refname>readgzfile</refname> - <refpurpose>output a gz-file</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcdef>int <function>readgzfile</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> - </funcsynopsis> - <para> Reads a file, decompresses it and writes it to standard - output. - - <para> - Readgzfile() can be used to read a file which is not in gzip - format; in this case readgzfile() will directly read from the - file without decompression. - - <para> Returns the number of (uncompressed) bytes read from the - file. If an error occurs, false is returned and unless the - function was called as @readgzfile, an error message is printed. - - <para> The file <parameter>filename</parameter> will be opened - from the filesystem and its contents written to standard output. - - <para> - See also <function>gzpassthru</function>, - <function>gzfile</function>, and <function>gzopen</function>. - - </refsect1> - </refentry> - - <refentry id="function.gzwrite"> <refnamediv> <refname>gzwrite</refname> @@ -447,6 +413,39 @@ <simpara> See also <function>gzread</function>, <function>gzopen</function>, and <function>gzputs</function>. + </refsect1> + </refentry> + + <refentry id="function.readgzfile"> + <refnamediv> + <refname>readgzfile</refname> + <refpurpose>output a gz-file</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>int <function>readgzfile</function></funcdef> + <paramdef>string <parameter>filename</parameter></paramdef> + </funcsynopsis> + <para> Reads a file, decompresses it and writes it to standard + output. + + <para> + Readgzfile() can be used to read a file which is not in gzip + format; in this case readgzfile() will directly read from the + file without decompression. + + <para> Returns the number of (uncompressed) bytes read from the + file. If an error occurs, false is returned and unless the + function was called as @readgzfile, an error message is printed. + + <para> The file <parameter>filename</parameter> will be opened + from the filesystem and its contents written to standard output. + + <para> + See also <function>gzpassthru</function>, + <function>gzfile</function>, and <function>gzopen</function>. + </refsect1> </refentry>

« previous php.dev (#10594) next »