cvs: /phpdoc/functions array.sgml

From: Date: Fri, 16 Jul 1999 17:43:06 +0000
Subject: cvs: /phpdoc/functions array.sgml
Groups: php.dev 
Request: Send a blank email to php-dev+get-8629@lists.php.net to get a copy of this message
andrey Fri Jul 16 17:43:06 1999 EDT Modified files: /phpdoc/functions array.sgml Log: Documented array_keys/array_values/in_array Index: phpdoc/functions/array.sgml diff -u phpdoc/functions/array.sgml:1.9 phpdoc/functions/array.sgml:1.10 --- phpdoc/functions/array.sgml:1.9 Fri Jul 16 17:12:20 1999 +++ phpdoc/functions/array.sgml Fri Jul 16 17:43:06 1999 @@ -371,8 +371,61 @@ </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> + + <para> + <function>array_keys</function> returns all the keys, numeric and string, from the <parameter>input</parameter> array. + + <para> + <example> + <title><function>array_keys</function> example</title> + <programlisting> +$array = array(0 => 100, "color" => "red"); +array_keys($array); // returns array(0, "color") + </programlisting> + </example> + <para> + See also <function>array_values</function>. + </refsect1> + </refentry> + + <refentry id="function.array-values"> + <refnamediv> + <refname>array_values</refname> + <refpurpose>Return all the values of an array</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>array <function>array_values</function></funcdef> + <paramdef>array <parameter>input</parameter></paramdef> + </funcsynopsis> + + <para> + <function>array_values</function> returns all the values from the <parameter>input</parameter> array. + <para> + <example> + <title><function>array_values</function> example</title> + <programlisting> +$array = array("size" => "XL", "color" => "gold"); +array_values($array); // returns array("XL", "gold") + </programlisting> + </example> + </refsect1> + </refentry> + <refentry id="function.array-walk"> <refnamediv> <refname>array_walk</refname> @@ -697,6 +750,36 @@ See also: <function>current</function>, <function>each</function>, <function>end</function> <function>next</function> and <function>reset</function> + </refsect1> + </refentry> + + <refentry id="function.in-array"> + <refnamediv> + <refname>in_array</refname> + <refpurpose>Check if a value exists in an array</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>bool in_array</funcdef> + <paramdef>mixed <parameter>needle</parameter></paramdef> + <paramdef>array <parameter>haystack</parameter></paramdef> + </funcsynopsis> + + <para> + Searches <parameter>haystack</parameter> for + <parameter>needle</parameter> and returns true if it is found in + the array, false otherwise. + + <para> + <example> + <title><function>in_array</function> example</title> + <programlisting> +$os = array("Mac", "NT", "Irix", "Linux"); +if (in_array("Irix", $os)) + print "Got Irix"; + </programlisting> + </example> </refsect1> </refentry>

« previous php.dev (#8629) next »