mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Documenting two functions:
array_change_key_case key_exists with examples... git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@61965 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
68e88055ce
commit
eb5e3c9b8a
1 changed files with 85 additions and 1 deletions
|
@ -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 @@ Array
|
|||
</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>
|
||||
|
@ -2508,6 +2555,43 @@ if (in_array(1.13, $a, TRUE))
|
|||
</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>
|
||||
|
||||
<refentry id="function.krsort">
|
||||
<refnamediv>
|
||||
<refname>krsort</refname>
|
||||
|
|
Loading…
Reference in a new issue