note 72694 deleted from control-structures.do.while by nlopess
| From: | nlopess@php.net | Date: | Thu, 15 Feb 2007 13:10:14 +0000 |
| Subject: | note 72694 deleted from control-structures.do.while by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123421@lists.php.net to get a copy of this message | ||
Note Submitter: yhoko at yhoko dot com
----
@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