note 72694 added to control-structures.do.while
| From: | yhoko at yhoko dot com | Date: | Tue, 30 Jan 2007 05:49:59 +0000 |
| Subject: | note 72694 added to control-structures.do.while | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122343@lists.php.net to get a copy of this message | ||
@rlynch at lynchmarks dot com:
I agree to your "at least once" rule, but spoken in code the while() solution is one line
shorter. This is my code that equals your loop:
<?php
$result = '';
while( $result === '' )
{
print "Gimme some skin, bro!> ";
$result = trim( fgets( $stdin ) );
}
?>
Just to clearify that do-loops aren't "shorter" or something.
- Yhoko
----
Server IP: 194.153.94.10
Probable Submitter: 62.202.17.204
----
Manual Page -- http://www.php.net/manual/en/control-structures.do.while.php
Edit -- https://master.php.net/note/edit/72694
Del: integrated -- https://master.php.net/note/delete/72694/integrated
Del: useless -- https://master.php.net/note/delete/72694/useless
Del: bad code -- https://master.php.net/note/delete/72694/bad+code
Del: spam -- https://master.php.net/note/delete/72694/spam
Del: non-english -- https://master.php.net/note/delete/72694/non-english
Del: in docs -- https://master.php.net/note/delete/72694/in+docs
Del: other reasons-- https://master.php.net/note/delete/72694
Reject -- https://master.php.net/note/reject/72694
Search -- https://master.php.net/manage/user-notes.php