| 
	
 | 
 Posted by JackM on 05/21/05 18:48 
Ewoud Dronkert wrote: 
 
> Shortest imperative version: 
>  
>   $rawdata = file('myfile.ext'); 
>   foreach ($rawdata as $line) { 
>     $arr = explode('-', trim($line)); 
>     if (strcmp('00', $arr[2])) {  //skip if arr[2] is 00 
>       //do stuff with $arr[0], $arr[1], etc. 
>     } 
>   } 
 
Thanks to all who offered solutions. You people are the best. It seems  
that Ewoud's suggestion is the easiest to implement and, better still,  
it works for my purposes. ;) I'll have to read up on the continue  
control structure to see if it would be suitable for other things I do.  
Much obliged to everyone.
 
[Back to original message] 
 |