-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I have been trying to pass the 'Easy' challenge JSON menu IDs, but my problem is that I always get 'Partially' status, though the code seems to be doing the job fine.
Here is my solution. Could you please point the flaws in it.
Thanks you in advance.
<?php
$fh = fopen($argv[1], "r");
while (!feof($fh)) {
$test = fgets($fh);
$arr = json_decode($test,true);
$output = 0;
foreach($arr['menu']['items'] as $value){
$output += intval($value['id']);
}
echo $output . "\n";
}
?>Metadata
Metadata
Assignees
Labels
No labels