I should print out some information from an array but I want it to stop at certain time, how do I do it?
foreach ($somtva as $s) echo "$s";
And I want to stop it when $s=="we", can I do this or must I use something different?
Thanks.
use the 'break' statement;
foreach ($array AS $value) { if ($value == "w") break; }
I think I did it myself 🙂
Any comments or suggestions about my way to solve it?
foreach($somtva as $s){
if($s=="we") break; echo "$s"; }
Thanks 🙂 you won by 15 secs 🙂