note 24353 deleted from control-structures.foreach by sniper
| From: | sniper@php.net | Date: | Wed, 08 Oct 2003 04:08:10 +0000 |
| Subject: | note 24353 deleted from control-structures.foreach by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58009@lists.php.net to get a copy of this message | ||
Note Submitter: andrew at eurozip dot net
----
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.