The txt file looks like this;
087654321:987654321:987654321:987654321:1232456789 ........ up to 10M
I am able to read the text file and explode the results;
- Code: Select all
$txt_file = file_get_contents('./10M.txt');
$pieces = explode(":", $txt_file);
$passed =1;
$failed= 0;
I would like to assign either 'PASSED' or 'FAILED' to each $pieces and then count the number of passes and fails.
- Code: Select all
foreach($pieces as $row)
{
if ($row == 987654321){
$count = $passed;
}
else {
$count = $failed;
}
}
I have tried several ideas and methods using count, str_len, str_count etc.. but I can never seem to get the correct count.
Any Ideas?




