Last active
May 18, 2025 08:38
-
-
Save timhtheos/ee7ff799ae884835b4e53f74487dd704 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $ch = curl_init('https://coderbyte.com/api/challenges/json/age-counting'); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
| curl_setopt($ch, CURLOPT_HEADER, 0); | |
| $data = curl_exec($ch); | |
| curl_close($ch); | |
| print_r(json_decode($data, true)); | |
| ?> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem Criteria
In the PHP file
PHPAgeCounting.php, write a program to perform a GET request on the route https://coderbyte.com/api/challenges/json/age-counting which contains adatakey and the values is a string which contains items in the format:key=STRING,age=INTEGER. Your goal is to count how many items exist that have an age equal to or greater than 50, and print this final value.Example Input
Example Output
Important Guidelines