note 24353 added to control-structures.foreach

From: Date: Tue, 13 Aug 2002 23:38:25 +0000
Subject: note 24353 added to control-structures.foreach
Groups: php.notes 
Request: Send a blank email to php-notes+get-34972@lists.php.net to get a copy of this message
In response: I got the former snippet to work with a do while statement, this was a brain wreck: foreach($files as $key => $value) do { if (strchr($value,".")) { echo "<a href=$value>$value</a><br>\n"; break; } else { echo "<a href=$value/>$value</a><br>\n"; break; } } while(0); Use it. -- http://www.php.net/manual/en/control-structures.foreach.php http://master.php.net/manage/user-notes.php?action=edit+24353 http://master.php.net/manage/user-notes.php?action=delete+24353 http://master.php.net/manage/user-notes.php?action=reject+24353

« previous php.notes (#34972) next »