Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP Challenge Re: PHP Challenge

#83525
djpic
Participant

Looks very simple. Personally, I would have looped through each line of the text file, check each line if it is a integer or character. If it is was an integer, add it to a $sum variable. If it was a character, then place that in an array like this:



$char[$currentLineValue] = $currentLineValue;
$char[$currentLineValue]++;

Then to display the results, echoed out the $sum and then:



foreach($char as $character) {
// echo out variables here
}