cvs: phpdoc /en/reference/imap/functions imap-rfc822-parse-adrlist.xml
| From: | Jeremy S. Johnstone | Date: | Sun, 02 Nov 2003 15:56:41 +0000 |
| Subject: | cvs: phpdoc /en/reference/imap/functions imap-rfc822-parse-adrlist.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969356796@lists.php.net to get a copy of this message | ||
jsjohnst Sun Nov 2 10:56:41 2003 EDT
Modified files:
/phpdoc/en/reference/imap/functions imap-rfc822-parse-adrlist.xml
Log:
Cleaned up example. Switched it to using foreach instead of while/list/each.
Also added extra sanity check as suggested in the notes (count($address_array) < 1).
Index: phpdoc/en/reference/imap/functions/imap-rfc822-parse-adrlist.xml
diff -u phpdoc/en/reference/imap/functions/imap-rfc822-parse-adrlist.xml:1.4
phpdoc/en/reference/imap/functions/imap-rfc822-parse-adrlist.xml:1.5
--- phpdoc/en/reference/imap/functions/imap-rfc822-parse-adrlist.xml:1.4 Wed Jul 16 13:14:40 2003
+++ phpdoc/en/reference/imap/functions/imap-rfc822-parse-adrlist.xml Sun Nov 2 10:56:41 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/imap.xml, last change in rev 1.2 -->
<refentry id="function.imap-rfc822-parse-adrlist">
<refnamediv>
@@ -51,10 +51,9 @@
<?php
$address_string = "Hartmut Holzgraefe <hartmut@cvs.php.net>, postmaster@somedomain.net,
root";
$address_array = imap_rfc822_parse_adrlist($address_string,"somedomain.net");
-if(! is_array($address_array)) die("somethings wrong\n");
+if(!is_array($address_array) || count($address_array) < 1) die("something is
wrong\n");
-reset($address_array);
-while(list($key,$val)=each($address_array)){
+foreach($address_array as $val) {
print "mailbox : ".$val->mailbox."<br>\n";
print "host : ".$val->host."<br>\n";
print "personal: ".$val->personal."<br>\n";