goba Sun Nov 11 06:02:32 2001 EDT
Modified files:
/phpdoc/en/functions array.xml
Log:
Documenting two functions:
array_change_key_case
key_exists
with examples...
Index: phpdoc/en/functions/array.xml
diff -u phpdoc/en/functions/array.xml:1.112 phpdoc/en/functions/array.xml:1.113
--- phpdoc/en/functions/array.xml:1.112 Sat Nov 10 17:11:39 2001
+++ phpdoc/en/functions/array.xml Sun Nov 11 06:02:32 2001
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.112 $ -->
+<!-- $Revision: 1.113 $ -->
<reference id="ref.array">
<title>Array Functions</title>
<titleabbrev>Arrays</titleabbrev>
@@ -134,6 +134,53 @@
</refsect1>
</refentry>
+ <refentry id="function.array-change-key-case">
+ <refnamediv>
+ <refname>array_change_key_case</refname>
+ <refpurpose>Retuns an array with all string keys lowercased or
+uppercased</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>array <function>array_change_key_case</function></funcdef>
+ <paramdef>array <parameter>input</parameter></paramdef>
+ <paramdef>int <parameter><optional>case</optional></parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>array_change_key_case</function> changes the
+ keys in the <parameter>input</parameter> array to
+ be all lowercase or uppercase. The change depends
+ on the last optional <parameter>case</parameter>
+ parameter. You can pass two constants there,
+ <constant>CASE_UPPER</constant> and
+ <constant>CASE_LOWER</constant>. The default is
+ <constant>CASE_LOWER</constant>. The function will leave
+ number indices as is.
+ </para>
+ <para>
+ <example>
+ <title><function>array_change_key_case</function> example</title>
+ <programlisting role="php">
+$input_array = array("FirSt" => 1, "SecOnd" => 4);
+print_r(array_change_key_case($input_array, CASE_UPPER);
+ </programlisting>
+ </example>
+ The printout of the above program will be:
+ <informalexample>
+ <programlisting>
+Array
+(
+ [FIRST] => 1
+ [SECOND] => 2
+)
+ </programlisting>
+ </informalexample>
+ </para>
+ </refsect1>
+ </refentry>
+
<refentry id="function.array-chunk">
<refnamediv>
<refname>array_chunk</refname>
@@ -2504,6 +2551,43 @@
</para>
<para>
See also <function>current</function> and <function>next</function>.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.key-exists">
+ <refnamediv>
+ <refname>key_exists</refname>
+ <refpurpose>Checks if the given key or index exists in the array</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>bool <function>key_exists</function></funcdef>
+ <paramdef>mixed <parameter>key</parameter></paramdef>
+ <paramdef>array <parameter>search</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>key_exists</function> returns &true; if the
+ given <parameter>key</parameter> is set in the array.
+ <parameter>key</parameter> can be any value possible
+ for an array index.
+ </para>
+ <para>
+ <example>
+ <title><function>key_exists</function> example</title>
+ <programlisting role="php">
+$search_array = array("first" => 1, "second" => 4);
+if (key_exists("first", $search_array)) {
+ echo "The 'first' element is in the array";
+}
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ See also <function>isset</function>.
</para>
</refsect1>
</refentry>