mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 17:08:54 +00:00
Indentation in examples should be 4 spaces.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@32291 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
09cfe326ae
commit
bf5feb767c
1 changed files with 44 additions and 43 deletions
|
@ -249,29 +249,29 @@ array_keys ($array, "blue"); // returns array (0, 3, 4)
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function was added to PHP4, below is an implementation for
|
||||
those still using PHP3.
|
||||
<example>
|
||||
<title>
|
||||
Implementation of <function>array_keys</function> for
|
||||
PHP3 users
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
function array_keys($arr, $term="") {
|
||||
$t = array();
|
||||
while (list($k,$v) = each($arr)) {
|
||||
if ($term && $v != $term)
|
||||
continue;
|
||||
$t[] = $k;
|
||||
}
|
||||
return $t;
|
||||
<note>
|
||||
<para>
|
||||
This function was added to PHP4, below is an implementation for
|
||||
those still using PHP3.
|
||||
<example>
|
||||
<title>
|
||||
Implementation of <function>array_keys</function> for PHP3
|
||||
users
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
function array_keys ($arr, $term="") {
|
||||
$t = array();
|
||||
while (list($k,$v) = each($arr)) {
|
||||
if ($term && $v != $term)
|
||||
continue;
|
||||
$t[] = $k;
|
||||
}
|
||||
return $t;
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</note>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>array_values</function>.
|
||||
</para>
|
||||
|
@ -1027,26 +1027,27 @@ array_values ($array); // returns array ("XL", "gold")
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function was added to PHP4, below is an implementation for
|
||||
those still using PHP3.
|
||||
<example>
|
||||
<title>
|
||||
Implementation of <function>array_values</function> for
|
||||
PHP3 users
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
function array_values($arr) {
|
||||
$t = array();
|
||||
while (list($k,$v) = each($arr))
|
||||
$t[] = $v;
|
||||
return $t;
|
||||
<note>
|
||||
<para>
|
||||
This function was added to PHP4, below is an implementation for
|
||||
those still using PHP3.
|
||||
<example>
|
||||
<title>
|
||||
Implementation of <function>array_values</function> for PHP3
|
||||
users
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
function array_values ($arr) {
|
||||
$t = array();
|
||||
while (list($k, $v) = each ($arr)) {
|
||||
$t[] = $v;
|
||||
return $t;
|
||||
}
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</note>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
@ -1111,11 +1112,11 @@ function array_values($arr) {
|
|||
$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
|
||||
|
||||
function test_alter (&$item1, $key, $prefix) {
|
||||
$item1 = "$prefix: $item1";
|
||||
$item1 = "$prefix: $item1";
|
||||
}
|
||||
|
||||
function test_print ($item2, $key) {
|
||||
echo "$key. $item2<br>\n";
|
||||
echo "$key. $item2<br>\n";
|
||||
}
|
||||
|
||||
array_walk ($fruits, 'test_print');
|
||||
|
|
Loading…
Reference in a new issue