cvs: phpdoc /en/reference/array/functions arsort.xml asort.xml krsort.xml ksort.xml rsort.xml shuffle.xml sort.xml uksort.xml usort.xml
/en/reference/classobj reference.xml /en/reference/dba reference.xml /en/reference/funchand/functions create-function.xml
/en/reference/ibase/functions ibase-execute.xml /en/reference/ifx/functions ifx-fieldproperties.xml ifx-fieldtypes.xml /en/reference/imap/functions
imap-fetch-overview.xml imap-getmailboxes.xml imap-list.xml imap-open.xml /en/reference/kadm5/functions kadm5-get-policies.xml
kadm5-get-principal.xml kadm5-get-principals.xml /en/reference/maxdb/functions maxdb-fetch-fields.xml maxdb-fetch-lengths.xml
/en/reference/mysqli/functions mysqli-fetch-fields.xml mysqli-fetch-lengths.xml /en/reference/oci8/functions oci-bind-by-name.xml oci-fetch-all.xml
ocibindbyname.xml /en/reference/pcre/functions preg-match-all.xml /en/reference/snmp/functions snmpwalk.xml /en/reference/strings/functions
count-chars.xml /en/reference/xml reference.xml /en/reference/xml/functions xml-parse-into-struct.xml /en/reference/yaz/functions yaz-scan.xml
| From: | Jakub Vrana | Date: | Fri, 01 Jul 2005 13:07:50 +0000 |
| Subject: | cvs: phpdoc /en/reference/array/functions arsort.xml asort.xml krsort.xml ksort.xml rsort.xml shuffle.xml sort.xml uksort.xml usort.xml /en/reference/classobj reference.xml /en/reference/dba reference.xml /en/reference/funchand/functions create-function.xml /en/reference/ibase/functions ibase-execute.xml /en/reference/ifx/functions ifx-fieldproperties.xml ifx-fieldtypes.xml /en/reference/imap/functions imap-fetch-overview.xml imap-getmailboxes.xml imap-list.xml imap-open.xml /en/reference/kadm5/functions kadm5-get-policies.xml kadm5-get-principal.xml kadm5-get-principals.xml /en/reference/maxdb/functions maxdb-fetch-fields.xml maxdb-fetch-lengths.xml /en/reference/mysqli/functions mysqli-fetch-fields.xml mysqli-fetch-lengths.xml /en/reference/oci8/functions oci-bind-by-name.xml oci-fetch-all.xml ocibindbyname.xml /en/reference/pcre/functions preg-match-all.xml /en/reference/snmp/functions snmpwalk.xml /en/reference/strings/functions count-chars.xml /en/reference/xml reference.xml /en/reference/xml/functions xml-parse-into-struct.xml /en/reference/yaz/functions yaz-scan.xml |
||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969368883@lists.php.net to get a copy of this message | ||
vrana Fri Jul 1 09:07:50 2005 EDT
Modified files:
/phpdoc/en/reference/array/functions arsort.xml asort.xml
krsort.xml ksort.xml rsort.xml
shuffle.xml sort.xml
uksort.xml usort.xml
/phpdoc/en/reference/classobj reference.xml
/phpdoc/en/reference/dba reference.xml
/phpdoc/en/reference/funchand/functions create-function.xml
/phpdoc/en/reference/ibase/functions ibase-execute.xml
/phpdoc/en/reference/ifx/functions ifx-fieldproperties.xml
ifx-fieldtypes.xml
/phpdoc/en/reference/imap/functions imap-fetch-overview.xml
imap-getmailboxes.xml
imap-list.xml imap-open.xml
/phpdoc/en/reference/kadm5/functions kadm5-get-policies.xml
kadm5-get-principal.xml
kadm5-get-principals.xml
/phpdoc/en/reference/maxdb/functions maxdb-fetch-fields.xml
maxdb-fetch-lengths.xml
/phpdoc/en/reference/mysqli/functions mysqli-fetch-fields.xml
mysqli-fetch-lengths.xml
/phpdoc/en/reference/oci8/functions oci-bind-by-name.xml
oci-fetch-all.xml
ocibindbyname.xml
/phpdoc/en/reference/pcre/functions preg-match-all.xml
/phpdoc/en/reference/snmp/functions snmpwalk.xml
/phpdoc/en/reference/strings/functions count-chars.xml
/phpdoc/en/reference/xml reference.xml
/phpdoc/en/reference/xml/functions xml-parse-into-struct.xml
/phpdoc/en/reference/yaz/functions yaz-scan.xml
Log:
Use foreach
http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/arsort.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc/en/reference/array/functions/arsort.xml diff -u phpdoc/en/reference/array/functions/arsort.xml:1.11 phpdoc/en/reference/array/functions/arsort.xml:1.12 --- phpdoc/en/reference/array/functions/arsort.xml:1.11 Wed Nov 10 03:30:20 2004 +++ phpdoc/en/reference/array/functions/arsort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.arsort"> <refnamediv> @@ -31,8 +31,7 @@ <?php $fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple"); arsort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "$key = $val\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/asort.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc/en/reference/array/functions/asort.xml diff -u phpdoc/en/reference/array/functions/asort.xml:1.11 phpdoc/en/reference/array/functions/asort.xml:1.12 --- phpdoc/en/reference/array/functions/asort.xml:1.11 Wed Nov 10 03:30:20 2004 +++ phpdoc/en/reference/array/functions/asort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.asort"> <refnamediv> @@ -29,8 +29,7 @@ <?php $fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple"); asort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "$key = $val\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/krsort.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc/en/reference/array/functions/krsort.xml diff -u phpdoc/en/reference/array/functions/krsort.xml:1.11 phpdoc/en/reference/array/functions/krsort.xml:1.12 --- phpdoc/en/reference/array/functions/krsort.xml:1.11 Wed Nov 10 03:30:21 2004 +++ phpdoc/en/reference/array/functions/krsort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.krsort"> <refnamediv> @@ -28,8 +28,7 @@ <?php $fruits = array("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple"); krsort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "$key = $val\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/ksort.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc/en/reference/array/functions/ksort.xml diff -u phpdoc/en/reference/array/functions/ksort.xml:1.11 phpdoc/en/reference/array/functions/ksort.xml:1.12 --- phpdoc/en/reference/array/functions/ksort.xml:1.11 Wed Nov 10 03:30:21 2004 +++ phpdoc/en/reference/array/functions/ksort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.ksort"> <refnamediv> @@ -28,8 +28,7 @@ <?php $fruits = array("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple"); ksort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "$key = $val\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/rsort.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc/en/reference/array/functions/rsort.xml diff -u phpdoc/en/reference/array/functions/rsort.xml:1.11 phpdoc/en/reference/array/functions/rsort.xml:1.12 --- phpdoc/en/reference/array/functions/rsort.xml:1.11 Wed Nov 10 03:30:22 2004 +++ phpdoc/en/reference/array/functions/rsort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.rsort"> <refnamediv> @@ -27,8 +27,7 @@ <?php $fruits = array("lemon", "orange", "banana", "apple"); rsort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "$key = $val\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/shuffle.xml?r1=1.12&r2=1.13&ty=u Index: phpdoc/en/reference/array/functions/shuffle.xml diff -u phpdoc/en/reference/array/functions/shuffle.xml:1.12 phpdoc/en/reference/array/functions/shuffle.xml:1.13 --- phpdoc/en/reference/array/functions/shuffle.xml:1.12 Wed Nov 10 03:30:22 2004 +++ phpdoc/en/reference/array/functions/shuffle.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> +<!-- $Revision: 1.13 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.shuffle"> <refnamediv> @@ -23,7 +23,7 @@ $numbers = range(1, 20); srand((float)microtime() * 1000000); shuffle($numbers); -while (list(, $number) = each($numbers)) { +foreach ($numbers as $number) { echo "$number "; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/sort.xml?r1=1.20&r2=1.21&ty=u Index: phpdoc/en/reference/array/functions/sort.xml diff -u phpdoc/en/reference/array/functions/sort.xml:1.20 phpdoc/en/reference/array/functions/sort.xml:1.21 --- phpdoc/en/reference/array/functions/sort.xml:1.20 Mon Jun 6 10:51:55 2005 +++ phpdoc/en/reference/array/functions/sort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.20 $ --> +<!-- $Revision: 1.21 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.sort"> <refnamediv> @@ -36,8 +36,7 @@ $fruits = array("lemon", "orange", "banana", "apple"); sort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "fruits[" . $key . "] = " . $val . "\n"; } http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/uksort.xml?r1=1.15&r2=1.16&ty=u Index: phpdoc/en/reference/array/functions/uksort.xml diff -u phpdoc/en/reference/array/functions/uksort.xml:1.15 phpdoc/en/reference/array/functions/uksort.xml:1.16 --- phpdoc/en/reference/array/functions/uksort.xml:1.15 Wed Nov 10 03:30:22 2004 +++ phpdoc/en/reference/array/functions/uksort.xml Fri Jul 1 09:07:47 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.15 $ --> +<!-- $Revision: 1.16 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.uksort"> <refnamediv> @@ -50,7 +50,7 @@ uksort($a, "cmp"); -while (list($key, $value) = each($a)) { +foreach ($a as $key => $value) { echo "$key: $value\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/usort.xml?r1=1.21&r2=1.22&ty=u Index: phpdoc/en/reference/array/functions/usort.xml diff -u phpdoc/en/reference/array/functions/usort.xml:1.21 phpdoc/en/reference/array/functions/usort.xml:1.22 --- phpdoc/en/reference/array/functions/usort.xml:1.21 Wed Nov 10 03:30:22 2004 +++ phpdoc/en/reference/array/functions/usort.xml Fri Jul 1 09:07:47 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.21 $ --> +<!-- $Revision: 1.22 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.usort"> <refnamediv> @@ -58,7 +58,7 @@ usort($a, "cmp"); -while (list($key, $value) = each($a)) { +foreach ($a as $key => $value) { echo "$key: $value\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/classobj/reference.xml?r1=1.12&r2=1.13&ty=u Index: phpdoc/en/reference/classobj/reference.xml diff -u phpdoc/en/reference/classobj/reference.xml:1.12 phpdoc/en/reference/classobj/reference.xml:1.13 --- phpdoc/en/reference/classobj/reference.xml:1.12 Thu Jan 15 07:42:04 2004 +++ phpdoc/en/reference/classobj/reference.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> +<!-- $Revision: 1.13 $ --> <reference id="ref.classobj"> <title>Class/Object Functions</title> <titleabbrev>Classes/Objects</titleabbrev> @@ -129,16 +129,17 @@ function print_vars($obj) { - $arr = get_object_vars($obj); - while (list($prop, $val) = each($arr)) + foreach (get_object_vars($obj) as $prop => $val) { echo "\t$prop = $val\n"; + } } function print_methods($obj) { $arr = get_class_methods(get_class($obj)); - foreach ($arr as $method) + foreach ($arr as $method) { echo "\tfunction $method()\n"; + } } function class_parentage($obj, $class) http://cvs.php.net/diff.php/phpdoc/en/reference/dba/reference.xml?r1=1.23&r2=1.24&ty=u Index: phpdoc/en/reference/dba/reference.xml diff -u phpdoc/en/reference/dba/reference.xml:1.23 phpdoc/en/reference/dba/reference.xml:1.24 --- phpdoc/en/reference/dba/reference.xml:1.23 Sun Apr 11 11:41:59 2004 +++ phpdoc/en/reference/dba/reference.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.23 $ --> +<!-- $Revision: 1.24 $ --> <reference id="ref.dba"> <title>Database (dbm-style) Abstraction Layer Functions</title> <titleabbrev>dba</titleabbrev> @@ -241,8 +241,8 @@ $key = dba_nextkey($id); } -for ($i = 0; $i < count($handle_later); $i++) { - dba_delete($handle_later[$i], $id); +foreach ($handle_later as $val) { + dba_delete($val, $id); } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/funchand/functions/create-function.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc/en/reference/funchand/functions/create-function.xml diff -u phpdoc/en/reference/funchand/functions/create-function.xml:1.6 phpdoc/en/reference/funchand/functions/create-function.xml:1.7 --- phpdoc/en/reference/funchand/functions/create-function.xml:1.6 Thu Jan 15 07:42:26 2004 +++ phpdoc/en/reference/funchand/functions/create-function.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- splitted from ./en/functions/funchand.xml, last change in rev 1.1 --> <refentry id="function.create-function"> <refnamediv> @@ -62,8 +62,8 @@ <?php function process($var1, $var2, $farr) { - for ($f=0; $f < count($farr); $f++) { - echo $farr[$f]($var1, $var2) . "\n"; + foreach ($farr as $f) { + echo $f($var1, $var2) . "\n"; } } http://cvs.php.net/diff.php/phpdoc/en/reference/ibase/functions/ibase-execute.xml?r1=1.9&r2=1.10&ty=u Index: phpdoc/en/reference/ibase/functions/ibase-execute.xml diff -u phpdoc/en/reference/ibase/functions/ibase-execute.xml:1.9 phpdoc/en/reference/ibase/functions/ibase-execute.xml:1.10 --- phpdoc/en/reference/ibase/functions/ibase-execute.xml:1.9 Sat Oct 30 11:57:32 2004 +++ phpdoc/en/reference/ibase/functions/ibase-execute.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <!-- splitted from ./en/functions/ibase.xml, last change in rev 1.2 --> <refentry id="function.ibase-execute"> <refnamediv> @@ -43,7 +43,7 @@ $query = ibase_prepare($dbh, "UPDATE FOO SET BAR = ? WHERE BAZ = ?"); -while (list($baz, $bar) = each($updates)) { +foreach ($updates as $baz => $bar) { ibase_execute($query, $bar, $baz); } http://cvs.php.net/diff.php/phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml diff -u phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml:1.4 phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml:1.5 --- phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml:1.4 Thu Dec 11 10:41:59 2003 +++ phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/ifx.xml, last change in rev 1.2 --> <refentry id="function.ifx-fieldproperties"> <refnamediv> @@ -29,14 +29,12 @@ <programlisting role="php"> <![CDATA[ <?php -$properties = ifx_fieldproperties ($resultid); -if (! isset($properties)) { +$properties = ifx_fieldproperties($resultid); +if (!isset($properties)) { /* ... error ... */ } -for ($i = 0; $i < count($properties); $i++) { - $fname = key ($properties); - printf ("%s:\t type = %s\n", $fname, $properties[$fname]); - next ($properties); +foreach ($properties as $fname => $val) { + echo "$fname:\t property = $val\n"; } ?> ]]> http://cvs.php.net/diff.php/phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml diff -u phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml:1.4 phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml:1.5 --- phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml:1.4 Thu Dec 11 10:41:59 2003 +++ phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/ifx.xml, last change in rev 1.2 --> <refentry id="function.ifx-fieldtypes"> <refnamediv> @@ -23,14 +23,12 @@ <programlisting role="php"> <![CDATA[ <?php -$types = ifx_fieldtypes ($resultid); -if (! isset ($types)) { +$types = ifx_fieldtypes($resultid); +if (!isset($types)) { /* ... error ... */ } -for ($i = 0; $i < count($types); $i++) { - $fname = key($types); - printf("%s :\t type = %s\n", $fname, $types[$fname]); - next($types); +foreach ($types as $fname => $val) { + echo "$fname:\t type = $val\n"; } ?> ]]> http://cvs.php.net/diff.php/phpdoc/en/reference/imap/functions/imap-fetch-overview.xml?r1=1.8&r2=1.9&ty=u Index: phpdoc/en/reference/imap/functions/imap-fetch-overview.xml diff -u phpdoc/en/reference/imap/functions/imap-fetch-overview.xml:1.8 phpdoc/en/reference/imap/functions/imap-fetch-overview.xml:1.9 --- phpdoc/en/reference/imap/functions/imap-fetch-overview.xml:1.8 Fri Jul 1 06:17:34 2005 +++ phpdoc/en/reference/imap/functions/imap-fetch-overview.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <!-- splitted from ./en/functions/imap.xml, last change in rev 1.33 --> <refentry id="function.imap-fetch-overview"> <refnamediv> @@ -118,13 +118,9 @@ $overview = imap_fetch_overview($mbox, "2,4:6", 0); if (is_array($overview)) { - reset($overview); - while (list($key, $val) = each($overview)) { - echo $val->msgno - . " - " . $val->date - . " - " . $val->subject - . "\n"; - } + foreach ($overview as $val) { + echo "$val->msgno - $val->date - $val->subject\n"; + } } imap_close($mbox); http://cvs.php.net/diff.php/phpdoc/en/reference/imap/functions/imap-getmailboxes.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc/en/reference/imap/functions/imap-getmailboxes.xml diff -u phpdoc/en/reference/imap/functions/imap-getmailboxes.xml:1.6 phpdoc/en/reference/imap/functions/imap-getmailboxes.xml:1.7 --- phpdoc/en/reference/imap/functions/imap-getmailboxes.xml:1.6 Mon Mar 8 04:18:41 2004 +++ phpdoc/en/reference/imap/functions/imap-getmailboxes.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- splitted from ./en/functions/imap.xml, last change in rev 1.2 --> <refentry id="function.imap-getmailboxes"> <refnamediv> @@ -86,15 +86,14 @@ $list = imap_getmailboxes($mbox, "{your.imap.host}", "*"); if (is_array($list)) { - reset($list); - while (list($key, $val) = each($list)) { - echo "($key) "; - echo imap_utf7_decode($val->name) . ","; - echo "'" . $val->delimiter . "',"; - echo $val->attributes . "<br />\n"; - } + foreach ($list as $key => $val) { + echo "($key) "; + echo imap_utf7_decode($val->name) . ","; + echo "'" . $val->delimiter . "',"; + echo $val->attributes . "<br />\n"; + } } else { - echo "imap_getmailboxes failed: " . imap_last_error() . "\n"; + echo "imap_getmailboxes failed: " . imap_last_error() . "\n"; } imap_close($mbox); http://cvs.php.net/diff.php/phpdoc/en/reference/imap/functions/imap-list.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/imap/functions/imap-list.xml diff -u phpdoc/en/reference/imap/functions/imap-list.xml:1.4 phpdoc/en/reference/imap/functions/imap-list.xml:1.5 --- phpdoc/en/reference/imap/functions/imap-list.xml:1.4 Mon Mar 8 04:18:42 2004 +++ phpdoc/en/reference/imap/functions/imap-list.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.imap-list"> <refnamediv> <refname>imap_list</refname> @@ -29,12 +29,11 @@ $list = imap_list($mbox, "{your.imap.host}", "*"); if (is_array($list)) { - reset($list); - while (list($key, $val) = each($list)) { - echo imap_utf7_decode($val) . "<br />\n"; - } + foreach ($list as $val) { + echo imap_utf7_decode($val) . "<br />\n"; + } } else { - echo "imap_list failed: " . imap_last_error() . "\n"; + echo "imap_list failed: " . imap_last_error() . "\n"; } imap_close($mbox); http://cvs.php.net/diff.php/phpdoc/en/reference/imap/functions/imap-open.xml?r1=1.8&r2=1.9&ty=u Index: phpdoc/en/reference/imap/functions/imap-open.xml diff -u phpdoc/en/reference/imap/functions/imap-open.xml:1.8 phpdoc/en/reference/imap/functions/imap-open.xml:1.9 --- phpdoc/en/reference/imap/functions/imap-open.xml:1.8 Sat Aug 7 04:02:25 2004 +++ phpdoc/en/reference/imap/functions/imap-open.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <!-- splitted from ./en/functions/imap.xml, last change in rev 1.2 --> <refentry id="function.imap-open"> <refnamediv> @@ -252,7 +252,7 @@ if ($folders == false) { echo "Call failed<br />\n"; } else { - while (list ($key, $val) = each($folders)) { + foreach ($folders as $val) { echo $val . "<br />\n"; } } @@ -263,7 +263,7 @@ if ($headers == false) { echo "Call failed<br />\n"; } else { - while (list ($key, $val) = each ($headers)) { + foreach ($headers as $val) { echo $val . "<br />\n"; } } http://cvs.php.net/diff.php/phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml diff -u phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml:1.3 phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml:1.4 --- phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml:1.3 Fri Jun 17 12:48:38 2005 +++ phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/kadm5.xml, last change in rev 1.3 --> <refentry id="function.kadm5-get-policies"> <refnamediv> @@ -34,13 +34,12 @@ <programlisting role="php"> <![CDATA[ <?php - $handle = kadm5_init_with_password("afs-1", "GONICUS.LOCAL", "admin/admin", "password"); print "<h1>get_policies</h1>\n"; -$policies = kadm5_get_policies($handle); -for ($i=0; $i < count($policies); $i++) - print "$policies[$i]<br />\n"; +foreach (kadm5_get_policies($handle) as $policy) { + echo "$policy<br />\n"; +} kadm5_destroy($handle); ?> http://cvs.php.net/diff.php/phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml diff -u phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml:1.2 phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml:1.3 --- phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml:1.2 Fri Jun 17 03:31:26 2005 +++ phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- splitted from ./en/functions/kadm5.xml, last change in rev 1.3 --> <refentry id="function.kadm5-get-principal"> <refnamediv> @@ -38,17 +38,14 @@ <programlisting role="php"> <![CDATA[ <?php - $handle = kadm5_init_with_password("afs-1", "GONICUS.LOCAL", "admin/admin", "password"); print "<h1>get_principal burbach@GONICUS.LOCAL</h1>\n"; $options = kadm5_get_principal($handle, "burbach@GONICUS.LOCAL" ); -$keys = array_keys($options); -for ($i=0; $i < count($keys); $i++) { - $value = $options[$keys[$i]]; - print "$keys[$i]: $value<br>\n"; +foreach ($options as $key => $value) { + echo "$key: $value<br />\n"; } kadm5_destroy($handle); http://cvs.php.net/diff.php/phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml diff -u phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml:1.3 phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml:1.4 --- phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml:1.3 Fri Jun 17 12:48:38 2005 +++ phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/kadm5.xml, last change in rev 1.3 --> <refentry id="function.kadm5-get-principals"> <refnamediv> @@ -34,13 +34,12 @@ <programlisting role="php"> <![CDATA[ <?php - $handle = kadm5_init_with_password("afs-1", "GONICUS.LOCAL", "admin/admin", "password"); print "<h1>get_principals</h1>\n"; -$principals = kadm5_get_principals($handle); -for ($i=0; $i < count($principals); $i++) - print "$principals[$i]<br />\n"; +foreach (kadm5_get_principals($handle) as $principal) { + echo "$principal<br />\n"; +} kadm5_destroy($handle); ?> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml:1.3 phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml:1.4 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml:1.3 Tue Mar 8 11:39:06 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.maxdb-fetch-fields"> <refnamediv> <refname>maxdb_fetch_fields</refname> @@ -96,12 +96,12 @@ /* Get field information for all columns */ $finfo = $result->fetch_fields(); - for ($i=0; $i < count($finfo); $i++) { - printf("Name: %s\n", $finfo[$i]->name); - printf("Table: %s\n", $finfo[$i]->table); - printf("max. Len: %d\n", $finfo[$i]->max_length); - printf("Flags: %d\n", $finfo[$i]->flags); - printf("Type: %d\n\n", $finfo[$i]->type); + foreach ($finfo as $val) { + printf("Name: %s\n", $val->name); + printf("Table: %s\n", $val->table); + printf("max. Len: %d\n", $val->max_length); + printf("Flags: %d\n", $val->flags); + printf("Type: %d\n\n", $val->type); } $result->close(); } @@ -132,12 +132,12 @@ /* Get field information for all columns */ $finfo = maxdb_fetch_fields($result); - for ($i=0; $i < count($finfo); $i++) { - printf("Name: %s\n", $finfo[$i]->name); - printf("Table: %s\n", $finfo[$i]->table); - printf("max. Len: %d\n", $finfo[$i]->max_length); - printf("Flags: %d\n", $finfo[$i]->flags); - printf("Type: %d\n\n", $finfo[$i]->type); + foreach ($finfo as $val) { + printf("Name: %s\n", $val->name); + printf("Table: %s\n", $val->table); + printf("max. Len: %d\n", $val->max_length); + printf("Flags: %d\n", $val->flags); + printf("Type: %d\n\n", $val->type); } maxdb_free_result($result); } http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml:1.3 phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml:1.4 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml:1.3 Thu Jun 23 12:53:23 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.maxdb-fetch-lengths"> <refnamediv> <refname>maxdb_fetch_lengths</refname> @@ -59,8 +59,8 @@ $row = $result->fetch_row(); /* display column lengths */ - for ($i=0; $i < count($result->lengths); $i++) { - printf("Field %2d has Length %2d\n", $i+1, $result->lengths[$i]); + foreach ($result->lengths as $i => $val) { + printf("Field %2d has Length %2d\n", $i+1, $val); } $result->close(); } @@ -91,9 +91,8 @@ $row = maxdb_fetch_row($result); /* display column lengths */ - $lengths = maxdb_fetch_lengths($result); - for ($i=0; $i < count($lengths); $i++) { - printf("Field %2d has Length %2d\n", $i+1, $lengths[$i]); + foreach (maxdb_fetch_lengths($result) as $i => $val) { + printf("Field %2d has Length %2d\n", $i+1, $val); } maxdb_free_result($result); } http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml?r1=1.17&r2=1.18&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.17 phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.18 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.17 Thu Jun 23 12:53:26 2005 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.17 $ --> +<!-- $Revision: 1.18 $ --> <refentry id="function.mysqli-fetch-fields"> <refnamediv> <refname>mysqli_fetch_fields</refname> @@ -115,12 +115,12 @@ /* Get field information for all columns */ $finfo = $result->fetch_fields(); - for ($i=0; $i < count($finfo); $i++) { - printf("Name: %s\n", $finfo[$i]->name); - printf("Table: %s\n", $finfo[$i]->table); - printf("max. Len: %d\n", $finfo[$i]->max_length); - printf("Flags: %d\n", $finfo[$i]->flags); - printf("Type: %d\n\n", $finfo[$i]->type); + foreach ($finfo as $val) { + printf("Name: %s\n", $val->name); + printf("Table: %s\n", $val->table); + printf("max. Len: %d\n", $val->max_length); + printf("Flags: %d\n", $val->flags); + printf("Type: %d\n\n", $val->type); } $result->close(); } @@ -151,12 +151,12 @@ /* Get field information for all columns */ $finfo = mysqli_fetch_fields($result); - for ($i=0; $i < count($finfo); $i++) { - printf("Name: %s\n", $finfo[$i]->name); - printf("Table: %s\n", $finfo[$i]->table); - printf("max. Len: %d\n", $finfo[$i]->max_length); - printf("Flags: %d\n", $finfo[$i]->flags); - printf("Type: %d\n\n", $finfo[$i]->type); + foreach ($finfo as $val) { + printf("Name: %s\n", $val->name); + printf("Table: %s\n", $val->table); + printf("max. Len: %d\n", $val->max_length); + printf("Flags: %d\n", $val->flags); + printf("Type: %d\n\n", $val->type); } mysqli_free_result($result); } http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml?r1=1.16&r2=1.17&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.16 phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.17 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.16 Thu Jun 23 12:53:26 2005 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.16 $ --> +<!-- $Revision: 1.17 $ --> <refentry id="function.mysqli-fetch-lengths"> <refnamediv> <refname>mysqli_fetch_lengths</refname> @@ -59,8 +59,8 @@ $row = $result->fetch_row(); /* display column lengths */ - for ($i=0; $i < count($result->lengths); $i++) { - printf("Field %2d has Length %2d\n", $i+1, $result->lengths[$i]); + foreach ($result->lengths as $i => $val) { + printf("Field %2d has Length %2d\n", $i+1, $val); } $result->close(); } @@ -91,9 +91,8 @@ $row = mysqli_fetch_row($result); /* display column lengths */ - $lengths = mysqli_fetch_lengths($result); - for ($i=0; $i < count($lengths); $i++) { - printf("Field %2d has Length %2d\n", $i+1, $lengths[$i]); + foreach (mysqli_fetch_lengths($result) as $i => $val) { + printf("Field %2d has Length %2d\n", $i+1, $val); } mysqli_free_result($result); } http://cvs.php.net/diff.php/phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml diff -u phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml:1.5 phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml:1.6 --- phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml:1.5 Wed Nov 10 03:30:36 2004 +++ phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.oci-bind-by-name"> <refnamediv> <refname>oci_bind_by_name</refname> @@ -124,9 +124,9 @@ $sal = 10000; -while (list($empno, $ename) = each($data)) { +foreach ($data as $empno => $ename) { oci_execute($stmt); - oci_execute($update); + oci_execute($update); } $rowid->free(); http://cvs.php.net/diff.php/phpdoc/en/reference/oci8/functions/oci-fetch-all.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/oci8/functions/oci-fetch-all.xml diff -u phpdoc/en/reference/oci8/functions/oci-fetch-all.xml:1.4 phpdoc/en/reference/oci8/functions/oci-fetch-all.xml:1.5 --- phpdoc/en/reference/oci8/functions/oci-fetch-all.xml:1.4 Wed Nov 10 03:30:36 2004 +++ phpdoc/en/reference/oci8/functions/oci-fetch-all.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.oci-fetch-all"> <refnamediv> <refname>oci_fetch_all</refname> @@ -63,16 +63,14 @@ if ($nrows > 0) { echo "<table border=\"1\">\n"; echo "<tr>\n"; - while (list($key, $val) = each($results)) { + foreach ($results as $key => $val) { echo "<th>$key</th>\n"; } echo "</tr>\n"; for ($i = 0; $i < $nrows; $i++) { - reset($results); echo "<tr>\n"; - while ($column = each($results)) { - $data = $column['value']; + foreach ($results as $data) { echo "<td>$data[$i]</td>\n"; } echo "</tr>\n"; http://cvs.php.net/diff.php/phpdoc/en/reference/oci8/functions/ocibindbyname.xml?r1=1.16&r2=1.17&ty=u Index: phpdoc/en/reference/oci8/functions/ocibindbyname.xml diff -u phpdoc/en/reference/oci8/functions/ocibindbyname.xml:1.16 phpdoc/en/reference/oci8/functions/ocibindbyname.xml:1.17 --- phpdoc/en/reference/oci8/functions/ocibindbyname.xml:1.16 Wed Nov 10 03:30:36 2004 +++ phpdoc/en/reference/oci8/functions/ocibindbyname.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.16 $ --> +<!-- $Revision: 1.17 $ --> <!-- DO NOT TRANSLATE THIS FILE. @@ -78,7 +78,7 @@ $sal = 10000; -while (list($empno, $ename) = each($data)) { +foreach ($data as $empno => $ename) { OCIExecute($stmt); OCIExecute($update); } http://cvs.php.net/diff.php/phpdoc/en/reference/pcre/functions/preg-match-all.xml?r1=1.18&r2=1.19&ty=u Index: phpdoc/en/reference/pcre/functions/preg-match-all.xml diff -u phpdoc/en/reference/pcre/functions/preg-match-all.xml:1.18 phpdoc/en/reference/pcre/functions/preg-match-all.xml:1.19 --- phpdoc/en/reference/pcre/functions/preg-match-all.xml:1.18 Wed Nov 10 03:30:40 2004 +++ phpdoc/en/reference/pcre/functions/preg-match-all.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.18 $ --> +<!-- $Revision: 1.19 $ --> <!-- splitted from ./en/functions/pcre.xml, last change in rev 1.2 --> <refentry id="function.preg-match-all"> <refnamediv> @@ -177,13 +177,13 @@ // required because the string is in double quotes. $html = "<b>bold text</b><a href=howdy.html>click me</a>"; -preg_match_all("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/", $html, $matches); +preg_match_all("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/", $html, $matches, PREG_SET_ORDER); -for ($i=0; $i< count($matches[0]); $i++) { - echo "matched: " . $matches[0][$i] . "\n"; - echo "part 1: " . $matches[1][$i] . "\n"; - echo "part 2: " . $matches[3][$i] . "\n"; - echo "part 3: " . $matches[4][$i] . "\n\n"; +foreach ($matches as $val) { + echo "matched: " . $val[0] . "\n"; + echo "part 1: " . $val[1] . "\n"; + echo "part 2: " . $val[3] . "\n"; + echo "part 3: " . $val[4] . "\n\n"; } ?> ]]> http://cvs.php.net/diff.php/phpdoc/en/reference/snmp/functions/snmpwalk.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/snmp/functions/snmpwalk.xml diff -u phpdoc/en/reference/snmp/functions/snmpwalk.xml:1.4 phpdoc/en/reference/snmp/functions/snmpwalk.xml:1.5 --- phpdoc/en/reference/snmp/functions/snmpwalk.xml:1.4 Tue Aug 3 13:25:34 2004 +++ phpdoc/en/reference/snmp/functions/snmpwalk.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/snmp.xml, last change in rev 1.2 --> <refentry id="function.snmpwalk"> <refnamediv> @@ -53,8 +53,8 @@ <programlisting role="php"> <![CDATA[ <?php -for ($i=0; $i < count($a); $i++) { - echo $a[$i]; +foreach ($a as $val) { + echo "$val\n"; } ?> ]]> http://cvs.php.net/diff.php/phpdoc/en/reference/strings/functions/count-chars.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc/en/reference/strings/functions/count-chars.xml diff -u phpdoc/en/reference/strings/functions/count-chars.xml:1.6 phpdoc/en/reference/strings/functions/count-chars.xml:1.7 --- phpdoc/en/reference/strings/functions/count-chars.xml:1.6 Sat Jul 31 05:56:10 2004 +++ phpdoc/en/reference/strings/functions/count-chars.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.4 --> <refentry id="function.count-chars"> <refnamediv> @@ -58,22 +58,15 @@ <programlisting role="php"> <![CDATA[ <?php - $data = "Two Ts and one F."; -$result = count_chars($data, 0); - -for ($i=0; $i < count($result); $i++) { - if ($result[$i] != 0) - echo "There were $result[$i] instance(s) of \"" , chr($i) , "\" in the string.\n"; +foreach (count_chars($data, 1) as $i => $val) { + echo "There were $val instance(s) of \"" , chr($i) , "\" in the string.\n"; } - ?> ]]> </programlisting> - <para> - This will output : - </para> + &example.outputs; <screen> <![CDATA[ There were 4 instance(s) of " " in the string. http://cvs.php.net/diff.php/phpdoc/en/reference/xml/reference.xml?r1=1.17&r2=1.18&ty=u Index: phpdoc/en/reference/xml/reference.xml diff -u phpdoc/en/reference/xml/reference.xml:1.17 phpdoc/en/reference/xml/reference.xml:1.18 --- phpdoc/en/reference/xml/reference.xml:1.17 Fri Aug 27 05:59:10 2004 +++ phpdoc/en/reference/xml/reference.xml Fri Jul 1 09:07:50 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.17 $ --> +<!-- $Revision: 1.18 $ --> <reference id="ref.xml"> <title>XML Parser Functions</title> <titleabbrev>XML</titleabbrev> @@ -422,8 +422,8 @@ function startElement($parser, $name, $attribs) { echo "<<font color=\"#0000cc\">$name</font>"; - if (sizeof($attribs)) { - while (list($k, $v) = each($attribs)) { + if (count($attribs)) { + foreach ($attribs as $k => $v) { echo " <font color=\"#009900\">$k</font>=\"<font color=\"#990000\">$v</font>\""; } http://cvs.php.net/diff.php/phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml?r1=1.12&r2=1.13&ty=u Index: phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml diff -u phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml:1.12 phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml:1.13 --- phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml:1.12 Thu May 12 13:19:06 2005 +++ phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml Fri Jul 1 09:07:50 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> +<!-- $Revision: 1.13 $ --> <!-- splitted from ./en/functions/xml.xml, last change in rev 1.11 --> <refentry id="function.xml-parse-into-struct"> <refnamediv> @@ -176,7 +176,7 @@ // each contiguous pair of array entries are the // lower and upper range for each molecule definition for ($i=0; $i < count($molranges); $i+=2) { - $offset = $molranges[$i] + 1; + $offset = $molranges[$i] + 1; $len = $molranges[$i + 1] - $offset; $tdb[] = parseMol(array_slice($values, $offset, $len)); } http://cvs.php.net/diff.php/phpdoc/en/reference/yaz/functions/yaz-scan.xml?r1=1.12&r2=1.13&ty=u Index: phpdoc/en/reference/yaz/functions/yaz-scan.xml diff -u phpdoc/en/reference/yaz/functions/yaz-scan.xml:1.12 phpdoc/en/reference/yaz/functions/yaz-scan.xml:1.13 --- phpdoc/en/reference/yaz/functions/yaz-scan.xml:1.12 Fri Jun 24 08:52:36 2005 +++ phpdoc/en/reference/yaz/functions/yaz-scan.xml Fri Jul 1 09:07:50 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> +<!-- $Revision: 1.13 $ --> <refentry id="function.yaz-scan"> <refnamediv> <refname>yaz_scan</refname> @@ -102,7 +102,7 @@ if ($errno == 0) { $ar = yaz_scan_result($id, &$options); echo 'Scan ok; '; - while (list($key, $val) = each($options)) { + foreach ($options as $key => $val) { echo "$key = $val "; } echo '<br /><table>';
http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/arsort.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc/en/reference/array/functions/arsort.xml diff -u phpdoc/en/reference/array/functions/arsort.xml:1.11 phpdoc/en/reference/array/functions/arsort.xml:1.12 --- phpdoc/en/reference/array/functions/arsort.xml:1.11 Wed Nov 10 03:30:20 2004 +++ phpdoc/en/reference/array/functions/arsort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.arsort"> <refnamediv> @@ -31,8 +31,7 @@ <?php $fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple"); arsort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "$key = $val\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/asort.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc/en/reference/array/functions/asort.xml diff -u phpdoc/en/reference/array/functions/asort.xml:1.11 phpdoc/en/reference/array/functions/asort.xml:1.12 --- phpdoc/en/reference/array/functions/asort.xml:1.11 Wed Nov 10 03:30:20 2004 +++ phpdoc/en/reference/array/functions/asort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.asort"> <refnamediv> @@ -29,8 +29,7 @@ <?php $fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple"); asort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "$key = $val\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/krsort.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc/en/reference/array/functions/krsort.xml diff -u phpdoc/en/reference/array/functions/krsort.xml:1.11 phpdoc/en/reference/array/functions/krsort.xml:1.12 --- phpdoc/en/reference/array/functions/krsort.xml:1.11 Wed Nov 10 03:30:21 2004 +++ phpdoc/en/reference/array/functions/krsort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.krsort"> <refnamediv> @@ -28,8 +28,7 @@ <?php $fruits = array("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple"); krsort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "$key = $val\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/ksort.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc/en/reference/array/functions/ksort.xml diff -u phpdoc/en/reference/array/functions/ksort.xml:1.11 phpdoc/en/reference/array/functions/ksort.xml:1.12 --- phpdoc/en/reference/array/functions/ksort.xml:1.11 Wed Nov 10 03:30:21 2004 +++ phpdoc/en/reference/array/functions/ksort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.ksort"> <refnamediv> @@ -28,8 +28,7 @@ <?php $fruits = array("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple"); ksort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "$key = $val\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/rsort.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc/en/reference/array/functions/rsort.xml diff -u phpdoc/en/reference/array/functions/rsort.xml:1.11 phpdoc/en/reference/array/functions/rsort.xml:1.12 --- phpdoc/en/reference/array/functions/rsort.xml:1.11 Wed Nov 10 03:30:22 2004 +++ phpdoc/en/reference/array/functions/rsort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.rsort"> <refnamediv> @@ -27,8 +27,7 @@ <?php $fruits = array("lemon", "orange", "banana", "apple"); rsort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "$key = $val\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/shuffle.xml?r1=1.12&r2=1.13&ty=u Index: phpdoc/en/reference/array/functions/shuffle.xml diff -u phpdoc/en/reference/array/functions/shuffle.xml:1.12 phpdoc/en/reference/array/functions/shuffle.xml:1.13 --- phpdoc/en/reference/array/functions/shuffle.xml:1.12 Wed Nov 10 03:30:22 2004 +++ phpdoc/en/reference/array/functions/shuffle.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> +<!-- $Revision: 1.13 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.shuffle"> <refnamediv> @@ -23,7 +23,7 @@ $numbers = range(1, 20); srand((float)microtime() * 1000000); shuffle($numbers); -while (list(, $number) = each($numbers)) { +foreach ($numbers as $number) { echo "$number "; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/sort.xml?r1=1.20&r2=1.21&ty=u Index: phpdoc/en/reference/array/functions/sort.xml diff -u phpdoc/en/reference/array/functions/sort.xml:1.20 phpdoc/en/reference/array/functions/sort.xml:1.21 --- phpdoc/en/reference/array/functions/sort.xml:1.20 Mon Jun 6 10:51:55 2005 +++ phpdoc/en/reference/array/functions/sort.xml Fri Jul 1 09:07:46 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.20 $ --> +<!-- $Revision: 1.21 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.sort"> <refnamediv> @@ -36,8 +36,7 @@ $fruits = array("lemon", "orange", "banana", "apple"); sort($fruits); -reset($fruits); -while (list($key, $val) = each($fruits)) { +foreach ($fruits as $key => $val) { echo "fruits[" . $key . "] = " . $val . "\n"; } http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/uksort.xml?r1=1.15&r2=1.16&ty=u Index: phpdoc/en/reference/array/functions/uksort.xml diff -u phpdoc/en/reference/array/functions/uksort.xml:1.15 phpdoc/en/reference/array/functions/uksort.xml:1.16 --- phpdoc/en/reference/array/functions/uksort.xml:1.15 Wed Nov 10 03:30:22 2004 +++ phpdoc/en/reference/array/functions/uksort.xml Fri Jul 1 09:07:47 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.15 $ --> +<!-- $Revision: 1.16 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.uksort"> <refnamediv> @@ -50,7 +50,7 @@ uksort($a, "cmp"); -while (list($key, $value) = each($a)) { +foreach ($a as $key => $value) { echo "$key: $value\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/usort.xml?r1=1.21&r2=1.22&ty=u Index: phpdoc/en/reference/array/functions/usort.xml diff -u phpdoc/en/reference/array/functions/usort.xml:1.21 phpdoc/en/reference/array/functions/usort.xml:1.22 --- phpdoc/en/reference/array/functions/usort.xml:1.21 Wed Nov 10 03:30:22 2004 +++ phpdoc/en/reference/array/functions/usort.xml Fri Jul 1 09:07:47 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.21 $ --> +<!-- $Revision: 1.22 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.usort"> <refnamediv> @@ -58,7 +58,7 @@ usort($a, "cmp"); -while (list($key, $value) = each($a)) { +foreach ($a as $key => $value) { echo "$key: $value\n"; } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/classobj/reference.xml?r1=1.12&r2=1.13&ty=u Index: phpdoc/en/reference/classobj/reference.xml diff -u phpdoc/en/reference/classobj/reference.xml:1.12 phpdoc/en/reference/classobj/reference.xml:1.13 --- phpdoc/en/reference/classobj/reference.xml:1.12 Thu Jan 15 07:42:04 2004 +++ phpdoc/en/reference/classobj/reference.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> +<!-- $Revision: 1.13 $ --> <reference id="ref.classobj"> <title>Class/Object Functions</title> <titleabbrev>Classes/Objects</titleabbrev> @@ -129,16 +129,17 @@ function print_vars($obj) { - $arr = get_object_vars($obj); - while (list($prop, $val) = each($arr)) + foreach (get_object_vars($obj) as $prop => $val) { echo "\t$prop = $val\n"; + } } function print_methods($obj) { $arr = get_class_methods(get_class($obj)); - foreach ($arr as $method) + foreach ($arr as $method) { echo "\tfunction $method()\n"; + } } function class_parentage($obj, $class) http://cvs.php.net/diff.php/phpdoc/en/reference/dba/reference.xml?r1=1.23&r2=1.24&ty=u Index: phpdoc/en/reference/dba/reference.xml diff -u phpdoc/en/reference/dba/reference.xml:1.23 phpdoc/en/reference/dba/reference.xml:1.24 --- phpdoc/en/reference/dba/reference.xml:1.23 Sun Apr 11 11:41:59 2004 +++ phpdoc/en/reference/dba/reference.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.23 $ --> +<!-- $Revision: 1.24 $ --> <reference id="ref.dba"> <title>Database (dbm-style) Abstraction Layer Functions</title> <titleabbrev>dba</titleabbrev> @@ -241,8 +241,8 @@ $key = dba_nextkey($id); } -for ($i = 0; $i < count($handle_later); $i++) { - dba_delete($handle_later[$i], $id); +foreach ($handle_later as $val) { + dba_delete($val, $id); } ?> http://cvs.php.net/diff.php/phpdoc/en/reference/funchand/functions/create-function.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc/en/reference/funchand/functions/create-function.xml diff -u phpdoc/en/reference/funchand/functions/create-function.xml:1.6 phpdoc/en/reference/funchand/functions/create-function.xml:1.7 --- phpdoc/en/reference/funchand/functions/create-function.xml:1.6 Thu Jan 15 07:42:26 2004 +++ phpdoc/en/reference/funchand/functions/create-function.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- splitted from ./en/functions/funchand.xml, last change in rev 1.1 --> <refentry id="function.create-function"> <refnamediv> @@ -62,8 +62,8 @@ <?php function process($var1, $var2, $farr) { - for ($f=0; $f < count($farr); $f++) { - echo $farr[$f]($var1, $var2) . "\n"; + foreach ($farr as $f) { + echo $f($var1, $var2) . "\n"; } } http://cvs.php.net/diff.php/phpdoc/en/reference/ibase/functions/ibase-execute.xml?r1=1.9&r2=1.10&ty=u Index: phpdoc/en/reference/ibase/functions/ibase-execute.xml diff -u phpdoc/en/reference/ibase/functions/ibase-execute.xml:1.9 phpdoc/en/reference/ibase/functions/ibase-execute.xml:1.10 --- phpdoc/en/reference/ibase/functions/ibase-execute.xml:1.9 Sat Oct 30 11:57:32 2004 +++ phpdoc/en/reference/ibase/functions/ibase-execute.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <!-- splitted from ./en/functions/ibase.xml, last change in rev 1.2 --> <refentry id="function.ibase-execute"> <refnamediv> @@ -43,7 +43,7 @@ $query = ibase_prepare($dbh, "UPDATE FOO SET BAR = ? WHERE BAZ = ?"); -while (list($baz, $bar) = each($updates)) { +foreach ($updates as $baz => $bar) { ibase_execute($query, $bar, $baz); } http://cvs.php.net/diff.php/phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml diff -u phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml:1.4 phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml:1.5 --- phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml:1.4 Thu Dec 11 10:41:59 2003 +++ phpdoc/en/reference/ifx/functions/ifx-fieldproperties.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/ifx.xml, last change in rev 1.2 --> <refentry id="function.ifx-fieldproperties"> <refnamediv> @@ -29,14 +29,12 @@ <programlisting role="php"> <![CDATA[ <?php -$properties = ifx_fieldproperties ($resultid); -if (! isset($properties)) { +$properties = ifx_fieldproperties($resultid); +if (!isset($properties)) { /* ... error ... */ } -for ($i = 0; $i < count($properties); $i++) { - $fname = key ($properties); - printf ("%s:\t type = %s\n", $fname, $properties[$fname]); - next ($properties); +foreach ($properties as $fname => $val) { + echo "$fname:\t property = $val\n"; } ?> ]]> http://cvs.php.net/diff.php/phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml diff -u phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml:1.4 phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml:1.5 --- phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml:1.4 Thu Dec 11 10:41:59 2003 +++ phpdoc/en/reference/ifx/functions/ifx-fieldtypes.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/ifx.xml, last change in rev 1.2 --> <refentry id="function.ifx-fieldtypes"> <refnamediv> @@ -23,14 +23,12 @@ <programlisting role="php"> <![CDATA[ <?php -$types = ifx_fieldtypes ($resultid); -if (! isset ($types)) { +$types = ifx_fieldtypes($resultid); +if (!isset($types)) { /* ... error ... */ } -for ($i = 0; $i < count($types); $i++) { - $fname = key($types); - printf("%s :\t type = %s\n", $fname, $types[$fname]); - next($types); +foreach ($types as $fname => $val) { + echo "$fname:\t type = $val\n"; } ?> ]]> http://cvs.php.net/diff.php/phpdoc/en/reference/imap/functions/imap-fetch-overview.xml?r1=1.8&r2=1.9&ty=u Index: phpdoc/en/reference/imap/functions/imap-fetch-overview.xml diff -u phpdoc/en/reference/imap/functions/imap-fetch-overview.xml:1.8 phpdoc/en/reference/imap/functions/imap-fetch-overview.xml:1.9 --- phpdoc/en/reference/imap/functions/imap-fetch-overview.xml:1.8 Fri Jul 1 06:17:34 2005 +++ phpdoc/en/reference/imap/functions/imap-fetch-overview.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <!-- splitted from ./en/functions/imap.xml, last change in rev 1.33 --> <refentry id="function.imap-fetch-overview"> <refnamediv> @@ -118,13 +118,9 @@ $overview = imap_fetch_overview($mbox, "2,4:6", 0); if (is_array($overview)) { - reset($overview); - while (list($key, $val) = each($overview)) { - echo $val->msgno - . " - " . $val->date - . " - " . $val->subject - . "\n"; - } + foreach ($overview as $val) { + echo "$val->msgno - $val->date - $val->subject\n"; + } } imap_close($mbox); http://cvs.php.net/diff.php/phpdoc/en/reference/imap/functions/imap-getmailboxes.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc/en/reference/imap/functions/imap-getmailboxes.xml diff -u phpdoc/en/reference/imap/functions/imap-getmailboxes.xml:1.6 phpdoc/en/reference/imap/functions/imap-getmailboxes.xml:1.7 --- phpdoc/en/reference/imap/functions/imap-getmailboxes.xml:1.6 Mon Mar 8 04:18:41 2004 +++ phpdoc/en/reference/imap/functions/imap-getmailboxes.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- splitted from ./en/functions/imap.xml, last change in rev 1.2 --> <refentry id="function.imap-getmailboxes"> <refnamediv> @@ -86,15 +86,14 @@ $list = imap_getmailboxes($mbox, "{your.imap.host}", "*"); if (is_array($list)) { - reset($list); - while (list($key, $val) = each($list)) { - echo "($key) "; - echo imap_utf7_decode($val->name) . ","; - echo "'" . $val->delimiter . "',"; - echo $val->attributes . "<br />\n"; - } + foreach ($list as $key => $val) { + echo "($key) "; + echo imap_utf7_decode($val->name) . ","; + echo "'" . $val->delimiter . "',"; + echo $val->attributes . "<br />\n"; + } } else { - echo "imap_getmailboxes failed: " . imap_last_error() . "\n"; + echo "imap_getmailboxes failed: " . imap_last_error() . "\n"; } imap_close($mbox); http://cvs.php.net/diff.php/phpdoc/en/reference/imap/functions/imap-list.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/imap/functions/imap-list.xml diff -u phpdoc/en/reference/imap/functions/imap-list.xml:1.4 phpdoc/en/reference/imap/functions/imap-list.xml:1.5 --- phpdoc/en/reference/imap/functions/imap-list.xml:1.4 Mon Mar 8 04:18:42 2004 +++ phpdoc/en/reference/imap/functions/imap-list.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.imap-list"> <refnamediv> <refname>imap_list</refname> @@ -29,12 +29,11 @@ $list = imap_list($mbox, "{your.imap.host}", "*"); if (is_array($list)) { - reset($list); - while (list($key, $val) = each($list)) { - echo imap_utf7_decode($val) . "<br />\n"; - } + foreach ($list as $val) { + echo imap_utf7_decode($val) . "<br />\n"; + } } else { - echo "imap_list failed: " . imap_last_error() . "\n"; + echo "imap_list failed: " . imap_last_error() . "\n"; } imap_close($mbox); http://cvs.php.net/diff.php/phpdoc/en/reference/imap/functions/imap-open.xml?r1=1.8&r2=1.9&ty=u Index: phpdoc/en/reference/imap/functions/imap-open.xml diff -u phpdoc/en/reference/imap/functions/imap-open.xml:1.8 phpdoc/en/reference/imap/functions/imap-open.xml:1.9 --- phpdoc/en/reference/imap/functions/imap-open.xml:1.8 Sat Aug 7 04:02:25 2004 +++ phpdoc/en/reference/imap/functions/imap-open.xml Fri Jul 1 09:07:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <!-- splitted from ./en/functions/imap.xml, last change in rev 1.2 --> <refentry id="function.imap-open"> <refnamediv> @@ -252,7 +252,7 @@ if ($folders == false) { echo "Call failed<br />\n"; } else { - while (list ($key, $val) = each($folders)) { + foreach ($folders as $val) { echo $val . "<br />\n"; } } @@ -263,7 +263,7 @@ if ($headers == false) { echo "Call failed<br />\n"; } else { - while (list ($key, $val) = each ($headers)) { + foreach ($headers as $val) { echo $val . "<br />\n"; } } http://cvs.php.net/diff.php/phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml diff -u phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml:1.3 phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml:1.4 --- phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml:1.3 Fri Jun 17 12:48:38 2005 +++ phpdoc/en/reference/kadm5/functions/kadm5-get-policies.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/kadm5.xml, last change in rev 1.3 --> <refentry id="function.kadm5-get-policies"> <refnamediv> @@ -34,13 +34,12 @@ <programlisting role="php"> <![CDATA[ <?php - $handle = kadm5_init_with_password("afs-1", "GONICUS.LOCAL", "admin/admin", "password"); print "<h1>get_policies</h1>\n"; -$policies = kadm5_get_policies($handle); -for ($i=0; $i < count($policies); $i++) - print "$policies[$i]<br />\n"; +foreach (kadm5_get_policies($handle) as $policy) { + echo "$policy<br />\n"; +} kadm5_destroy($handle); ?> http://cvs.php.net/diff.php/phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml diff -u phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml:1.2 phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml:1.3 --- phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml:1.2 Fri Jun 17 03:31:26 2005 +++ phpdoc/en/reference/kadm5/functions/kadm5-get-principal.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- splitted from ./en/functions/kadm5.xml, last change in rev 1.3 --> <refentry id="function.kadm5-get-principal"> <refnamediv> @@ -38,17 +38,14 @@ <programlisting role="php"> <![CDATA[ <?php - $handle = kadm5_init_with_password("afs-1", "GONICUS.LOCAL", "admin/admin", "password"); print "<h1>get_principal burbach@GONICUS.LOCAL</h1>\n"; $options = kadm5_get_principal($handle, "burbach@GONICUS.LOCAL" ); -$keys = array_keys($options); -for ($i=0; $i < count($keys); $i++) { - $value = $options[$keys[$i]]; - print "$keys[$i]: $value<br>\n"; +foreach ($options as $key => $value) { + echo "$key: $value<br />\n"; } kadm5_destroy($handle); http://cvs.php.net/diff.php/phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml diff -u phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml:1.3 phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml:1.4 --- phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml:1.3 Fri Jun 17 12:48:38 2005 +++ phpdoc/en/reference/kadm5/functions/kadm5-get-principals.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/kadm5.xml, last change in rev 1.3 --> <refentry id="function.kadm5-get-principals"> <refnamediv> @@ -34,13 +34,12 @@ <programlisting role="php"> <![CDATA[ <?php - $handle = kadm5_init_with_password("afs-1", "GONICUS.LOCAL", "admin/admin", "password"); print "<h1>get_principals</h1>\n"; -$principals = kadm5_get_principals($handle); -for ($i=0; $i < count($principals); $i++) - print "$principals[$i]<br />\n"; +foreach (kadm5_get_principals($handle) as $principal) { + echo "$principal<br />\n"; +} kadm5_destroy($handle); ?> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml:1.3 phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml:1.4 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml:1.3 Tue Mar 8 11:39:06 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.maxdb-fetch-fields"> <refnamediv> <refname>maxdb_fetch_fields</refname> @@ -96,12 +96,12 @@ /* Get field information for all columns */ $finfo = $result->fetch_fields(); - for ($i=0; $i < count($finfo); $i++) { - printf("Name: %s\n", $finfo[$i]->name); - printf("Table: %s\n", $finfo[$i]->table); - printf("max. Len: %d\n", $finfo[$i]->max_length); - printf("Flags: %d\n", $finfo[$i]->flags); - printf("Type: %d\n\n", $finfo[$i]->type); + foreach ($finfo as $val) { + printf("Name: %s\n", $val->name); + printf("Table: %s\n", $val->table); + printf("max. Len: %d\n", $val->max_length); + printf("Flags: %d\n", $val->flags); + printf("Type: %d\n\n", $val->type); } $result->close(); } @@ -132,12 +132,12 @@ /* Get field information for all columns */ $finfo = maxdb_fetch_fields($result); - for ($i=0; $i < count($finfo); $i++) { - printf("Name: %s\n", $finfo[$i]->name); - printf("Table: %s\n", $finfo[$i]->table); - printf("max. Len: %d\n", $finfo[$i]->max_length); - printf("Flags: %d\n", $finfo[$i]->flags); - printf("Type: %d\n\n", $finfo[$i]->type); + foreach ($finfo as $val) { + printf("Name: %s\n", $val->name); + printf("Table: %s\n", $val->table); + printf("max. Len: %d\n", $val->max_length); + printf("Flags: %d\n", $val->flags); + printf("Type: %d\n\n", $val->type); } maxdb_free_result($result); } http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml:1.3 phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml:1.4 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml:1.3 Thu Jun 23 12:53:23 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.maxdb-fetch-lengths"> <refnamediv> <refname>maxdb_fetch_lengths</refname> @@ -59,8 +59,8 @@ $row = $result->fetch_row(); /* display column lengths */ - for ($i=0; $i < count($result->lengths); $i++) { - printf("Field %2d has Length %2d\n", $i+1, $result->lengths[$i]); + foreach ($result->lengths as $i => $val) { + printf("Field %2d has Length %2d\n", $i+1, $val); } $result->close(); } @@ -91,9 +91,8 @@ $row = maxdb_fetch_row($result); /* display column lengths */ - $lengths = maxdb_fetch_lengths($result); - for ($i=0; $i < count($lengths); $i++) { - printf("Field %2d has Length %2d\n", $i+1, $lengths[$i]); + foreach (maxdb_fetch_lengths($result) as $i => $val) { + printf("Field %2d has Length %2d\n", $i+1, $val); } maxdb_free_result($result); } http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml?r1=1.17&r2=1.18&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.17 phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.18 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.17 Thu Jun 23 12:53:26 2005 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.17 $ --> +<!-- $Revision: 1.18 $ --> <refentry id="function.mysqli-fetch-fields"> <refnamediv> <refname>mysqli_fetch_fields</refname> @@ -115,12 +115,12 @@ /* Get field information for all columns */ $finfo = $result->fetch_fields(); - for ($i=0; $i < count($finfo); $i++) { - printf("Name: %s\n", $finfo[$i]->name); - printf("Table: %s\n", $finfo[$i]->table); - printf("max. Len: %d\n", $finfo[$i]->max_length); - printf("Flags: %d\n", $finfo[$i]->flags); - printf("Type: %d\n\n", $finfo[$i]->type); + foreach ($finfo as $val) { + printf("Name: %s\n", $val->name); + printf("Table: %s\n", $val->table); + printf("max. Len: %d\n", $val->max_length); + printf("Flags: %d\n", $val->flags); + printf("Type: %d\n\n", $val->type); } $result->close(); } @@ -151,12 +151,12 @@ /* Get field information for all columns */ $finfo = mysqli_fetch_fields($result); - for ($i=0; $i < count($finfo); $i++) { - printf("Name: %s\n", $finfo[$i]->name); - printf("Table: %s\n", $finfo[$i]->table); - printf("max. Len: %d\n", $finfo[$i]->max_length); - printf("Flags: %d\n", $finfo[$i]->flags); - printf("Type: %d\n\n", $finfo[$i]->type); + foreach ($finfo as $val) { + printf("Name: %s\n", $val->name); + printf("Table: %s\n", $val->table); + printf("max. Len: %d\n", $val->max_length); + printf("Flags: %d\n", $val->flags); + printf("Type: %d\n\n", $val->type); } mysqli_free_result($result); } http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml?r1=1.16&r2=1.17&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.16 phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.17 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.16 Thu Jun 23 12:53:26 2005 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.16 $ --> +<!-- $Revision: 1.17 $ --> <refentry id="function.mysqli-fetch-lengths"> <refnamediv> <refname>mysqli_fetch_lengths</refname> @@ -59,8 +59,8 @@ $row = $result->fetch_row(); /* display column lengths */ - for ($i=0; $i < count($result->lengths); $i++) { - printf("Field %2d has Length %2d\n", $i+1, $result->lengths[$i]); + foreach ($result->lengths as $i => $val) { + printf("Field %2d has Length %2d\n", $i+1, $val); } $result->close(); } @@ -91,9 +91,8 @@ $row = mysqli_fetch_row($result); /* display column lengths */ - $lengths = mysqli_fetch_lengths($result); - for ($i=0; $i < count($lengths); $i++) { - printf("Field %2d has Length %2d\n", $i+1, $lengths[$i]); + foreach (mysqli_fetch_lengths($result) as $i => $val) { + printf("Field %2d has Length %2d\n", $i+1, $val); } mysqli_free_result($result); } http://cvs.php.net/diff.php/phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml diff -u phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml:1.5 phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml:1.6 --- phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml:1.5 Wed Nov 10 03:30:36 2004 +++ phpdoc/en/reference/oci8/functions/oci-bind-by-name.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.oci-bind-by-name"> <refnamediv> <refname>oci_bind_by_name</refname> @@ -124,9 +124,9 @@ $sal = 10000; -while (list($empno, $ename) = each($data)) { +foreach ($data as $empno => $ename) { oci_execute($stmt); - oci_execute($update); + oci_execute($update); } $rowid->free(); http://cvs.php.net/diff.php/phpdoc/en/reference/oci8/functions/oci-fetch-all.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/oci8/functions/oci-fetch-all.xml diff -u phpdoc/en/reference/oci8/functions/oci-fetch-all.xml:1.4 phpdoc/en/reference/oci8/functions/oci-fetch-all.xml:1.5 --- phpdoc/en/reference/oci8/functions/oci-fetch-all.xml:1.4 Wed Nov 10 03:30:36 2004 +++ phpdoc/en/reference/oci8/functions/oci-fetch-all.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.oci-fetch-all"> <refnamediv> <refname>oci_fetch_all</refname> @@ -63,16 +63,14 @@ if ($nrows > 0) { echo "<table border=\"1\">\n"; echo "<tr>\n"; - while (list($key, $val) = each($results)) { + foreach ($results as $key => $val) { echo "<th>$key</th>\n"; } echo "</tr>\n"; for ($i = 0; $i < $nrows; $i++) { - reset($results); echo "<tr>\n"; - while ($column = each($results)) { - $data = $column['value']; + foreach ($results as $data) { echo "<td>$data[$i]</td>\n"; } echo "</tr>\n"; http://cvs.php.net/diff.php/phpdoc/en/reference/oci8/functions/ocibindbyname.xml?r1=1.16&r2=1.17&ty=u Index: phpdoc/en/reference/oci8/functions/ocibindbyname.xml diff -u phpdoc/en/reference/oci8/functions/ocibindbyname.xml:1.16 phpdoc/en/reference/oci8/functions/ocibindbyname.xml:1.17 --- phpdoc/en/reference/oci8/functions/ocibindbyname.xml:1.16 Wed Nov 10 03:30:36 2004 +++ phpdoc/en/reference/oci8/functions/ocibindbyname.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.16 $ --> +<!-- $Revision: 1.17 $ --> <!-- DO NOT TRANSLATE THIS FILE. @@ -78,7 +78,7 @@ $sal = 10000; -while (list($empno, $ename) = each($data)) { +foreach ($data as $empno => $ename) { OCIExecute($stmt); OCIExecute($update); } http://cvs.php.net/diff.php/phpdoc/en/reference/pcre/functions/preg-match-all.xml?r1=1.18&r2=1.19&ty=u Index: phpdoc/en/reference/pcre/functions/preg-match-all.xml diff -u phpdoc/en/reference/pcre/functions/preg-match-all.xml:1.18 phpdoc/en/reference/pcre/functions/preg-match-all.xml:1.19 --- phpdoc/en/reference/pcre/functions/preg-match-all.xml:1.18 Wed Nov 10 03:30:40 2004 +++ phpdoc/en/reference/pcre/functions/preg-match-all.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.18 $ --> +<!-- $Revision: 1.19 $ --> <!-- splitted from ./en/functions/pcre.xml, last change in rev 1.2 --> <refentry id="function.preg-match-all"> <refnamediv> @@ -177,13 +177,13 @@ // required because the string is in double quotes. $html = "<b>bold text</b><a href=howdy.html>click me</a>"; -preg_match_all("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/", $html, $matches); +preg_match_all("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/", $html, $matches, PREG_SET_ORDER); -for ($i=0; $i< count($matches[0]); $i++) { - echo "matched: " . $matches[0][$i] . "\n"; - echo "part 1: " . $matches[1][$i] . "\n"; - echo "part 2: " . $matches[3][$i] . "\n"; - echo "part 3: " . $matches[4][$i] . "\n\n"; +foreach ($matches as $val) { + echo "matched: " . $val[0] . "\n"; + echo "part 1: " . $val[1] . "\n"; + echo "part 2: " . $val[3] . "\n"; + echo "part 3: " . $val[4] . "\n\n"; } ?> ]]> http://cvs.php.net/diff.php/phpdoc/en/reference/snmp/functions/snmpwalk.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/snmp/functions/snmpwalk.xml diff -u phpdoc/en/reference/snmp/functions/snmpwalk.xml:1.4 phpdoc/en/reference/snmp/functions/snmpwalk.xml:1.5 --- phpdoc/en/reference/snmp/functions/snmpwalk.xml:1.4 Tue Aug 3 13:25:34 2004 +++ phpdoc/en/reference/snmp/functions/snmpwalk.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/snmp.xml, last change in rev 1.2 --> <refentry id="function.snmpwalk"> <refnamediv> @@ -53,8 +53,8 @@ <programlisting role="php"> <![CDATA[ <?php -for ($i=0; $i < count($a); $i++) { - echo $a[$i]; +foreach ($a as $val) { + echo "$val\n"; } ?> ]]> http://cvs.php.net/diff.php/phpdoc/en/reference/strings/functions/count-chars.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc/en/reference/strings/functions/count-chars.xml diff -u phpdoc/en/reference/strings/functions/count-chars.xml:1.6 phpdoc/en/reference/strings/functions/count-chars.xml:1.7 --- phpdoc/en/reference/strings/functions/count-chars.xml:1.6 Sat Jul 31 05:56:10 2004 +++ phpdoc/en/reference/strings/functions/count-chars.xml Fri Jul 1 09:07:49 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.4 --> <refentry id="function.count-chars"> <refnamediv> @@ -58,22 +58,15 @@ <programlisting role="php"> <![CDATA[ <?php - $data = "Two Ts and one F."; -$result = count_chars($data, 0); - -for ($i=0; $i < count($result); $i++) { - if ($result[$i] != 0) - echo "There were $result[$i] instance(s) of \"" , chr($i) , "\" in the string.\n"; +foreach (count_chars($data, 1) as $i => $val) { + echo "There were $val instance(s) of \"" , chr($i) , "\" in the string.\n"; } - ?> ]]> </programlisting> - <para> - This will output : - </para> + &example.outputs; <screen> <![CDATA[ There were 4 instance(s) of " " in the string. http://cvs.php.net/diff.php/phpdoc/en/reference/xml/reference.xml?r1=1.17&r2=1.18&ty=u Index: phpdoc/en/reference/xml/reference.xml diff -u phpdoc/en/reference/xml/reference.xml:1.17 phpdoc/en/reference/xml/reference.xml:1.18 --- phpdoc/en/reference/xml/reference.xml:1.17 Fri Aug 27 05:59:10 2004 +++ phpdoc/en/reference/xml/reference.xml Fri Jul 1 09:07:50 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.17 $ --> +<!-- $Revision: 1.18 $ --> <reference id="ref.xml"> <title>XML Parser Functions</title> <titleabbrev>XML</titleabbrev> @@ -422,8 +422,8 @@ function startElement($parser, $name, $attribs) { echo "<<font color=\"#0000cc\">$name</font>"; - if (sizeof($attribs)) { - while (list($k, $v) = each($attribs)) { + if (count($attribs)) { + foreach ($attribs as $k => $v) { echo " <font color=\"#009900\">$k</font>=\"<font color=\"#990000\">$v</font>\""; } http://cvs.php.net/diff.php/phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml?r1=1.12&r2=1.13&ty=u Index: phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml diff -u phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml:1.12 phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml:1.13 --- phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml:1.12 Thu May 12 13:19:06 2005 +++ phpdoc/en/reference/xml/functions/xml-parse-into-struct.xml Fri Jul 1 09:07:50 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> +<!-- $Revision: 1.13 $ --> <!-- splitted from ./en/functions/xml.xml, last change in rev 1.11 --> <refentry id="function.xml-parse-into-struct"> <refnamediv> @@ -176,7 +176,7 @@ // each contiguous pair of array entries are the // lower and upper range for each molecule definition for ($i=0; $i < count($molranges); $i+=2) { - $offset = $molranges[$i] + 1; + $offset = $molranges[$i] + 1; $len = $molranges[$i + 1] - $offset; $tdb[] = parseMol(array_slice($values, $offset, $len)); } http://cvs.php.net/diff.php/phpdoc/en/reference/yaz/functions/yaz-scan.xml?r1=1.12&r2=1.13&ty=u Index: phpdoc/en/reference/yaz/functions/yaz-scan.xml diff -u phpdoc/en/reference/yaz/functions/yaz-scan.xml:1.12 phpdoc/en/reference/yaz/functions/yaz-scan.xml:1.13 --- phpdoc/en/reference/yaz/functions/yaz-scan.xml:1.12 Fri Jun 24 08:52:36 2005 +++ phpdoc/en/reference/yaz/functions/yaz-scan.xml Fri Jul 1 09:07:50 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> +<!-- $Revision: 1.13 $ --> <refentry id="function.yaz-scan"> <refnamediv> <refname>yaz_scan</refname> @@ -102,7 +102,7 @@ if ($errno == 0) { $ar = yaz_scan_result($id, &$options); echo 'Scan ok; '; - while (list($key, $val) = each($options)) { + foreach ($options as $key => $val) { echo "$key = $val "; } echo '<br /><table>';