Re: stoping a while statement

From: Date: Wed, 10 Oct 2001 08:37:48 +0000
Subject: Re: stoping a while statement
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70589@lists.php.net to get a copy of this message
I total re-write: $variable="www.tester.com"; $i="www.northwesthost.com,dns1.northwesthost.com,dns2.northwesthost.com,www. tester.com"; $domains = split(",", $i); while (list(, $val) == each($domains)) { if ($val==$variable) {echo 'blah blah...'; break;} } "Richard Kurth" <rkurth@pacifier.com> wrote in message news:14533927343.20011010002342@pacifier.com... > > What do I need in the While statement so it will stop when it gets > to the end of the $i variable. > > > > $variable="www.tester.com"; > $i="www.northwesthost.com,dns1.northwesthost.com,dns2.northwesthost.com,www. tester.com"; > > $count = 0; > while($i ==true) { <--what do I need hear so it will stop > $line_text =$i; > $strings = explode(",", $line_text); > if ($variable == trim($strings[$count])) { > print("<b> Domain $variable is already > there</b><br>"); > break; > } > ++$count; > } > > > > > > > > > > > > Best regards, > Richard > mailto:rkurth@pacifier.com >

« previous php.general (#70589) next »