mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
corrected the *sort examples according to bug #5053
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@26369 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
2a40aab64b
commit
ff6b25913d
1 changed files with 18 additions and 12 deletions
|
@ -783,8 +783,9 @@ array_walk ($fruits, 'test_print');
|
|||
<programlisting role="php">
|
||||
$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
|
||||
arsort ($fruits);
|
||||
for (reset ($fruits); $key = key ($fruits); next ($fruits)) {
|
||||
echo "fruits[$key] = ".$fruits[$key]."\n";
|
||||
reset($fruits);
|
||||
while(list($key,$val)=each($fruits)) {
|
||||
echo "$key = $val\n";
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
@ -826,8 +827,9 @@ fruits[c] = apple
|
|||
<programlisting role="php">
|
||||
$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
|
||||
asort ($fruits);
|
||||
for (reset ($fruits); $key = key ($fruits); next ($fruits)) {
|
||||
echo "fruits[$key] = ".$fruits[$key]."\n";
|
||||
reset($fruits);
|
||||
while(list($key,$val)=each($fruits)) {
|
||||
echo "$key = $val\n";
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
@ -1310,8 +1312,9 @@ if (in_array ("Irix", $os))
|
|||
<programlisting role="php">
|
||||
$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
|
||||
krsort ($fruits);
|
||||
for (reset ($fruits); $key = key ($fruits); next ($fruits)) {
|
||||
echo "fruits[$key] = ".$fruits[$key]."\n";
|
||||
reset($fruits);
|
||||
while(list($key,$val)=each($fruits)) {
|
||||
echo "$key -> $val\n";
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
@ -1350,8 +1353,9 @@ fruits[a] = orange
|
|||
<programlisting role="php">
|
||||
$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
|
||||
ksort ($fruits);
|
||||
for (reset ($fruits); $key = key ($fruits); next ($fruits)) {
|
||||
echo "fruits[$key] = ".$fruits[$key]."\n";
|
||||
reset($fruits);
|
||||
while(list($key,$val)=each($fruits)) {
|
||||
echo "$key -> $val\n";
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
@ -1590,8 +1594,9 @@ while (list($id, $name, $salary) = mysql_fetch_row($result)) {
|
|||
<programlisting role="php">
|
||||
$fruits = array ("lemon", "orange", "banana", "apple");
|
||||
rsort ($fruits);
|
||||
for (reset ($fruits); list ($key, $value) = each ($fruits); ) {
|
||||
echo "fruits[$key] = ", $value, "\n";
|
||||
reset($fruits);
|
||||
while(list($key,$val)=each($fruits)) {
|
||||
echo "$key -> $val\n";
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
@ -1685,8 +1690,9 @@ while (list(, $number) = each ($numbers)) {
|
|||
<programlisting role="php">
|
||||
$fruits = array ("lemon", "orange", "banana", "apple");
|
||||
sort ($fruits);
|
||||
for (reset ($fruits); $key = key ($fruits); next ($fruits)) {
|
||||
echo "fruits[$key] = ".$fruits[$key]."\n";
|
||||
reset($fruits);
|
||||
while(list($key,$val)=each($fruits)) {
|
||||
echo "$key -> $val\n";
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue