this is my code , and I am trying to loop through this json, so what I want to do is when isset($_GET['latest=1'])) it should show one object from json above, if latest=15 it should show 15 objects, how can I do that
    <?php
header('Content-Type: application/json');
if(isset($_GET['latest']))
echo 
'
    {
        "contacts": [
            {
                    "id": "c200",
                    "name": "Ravi Tamada",
                    "email": "ravi@gmail.com",
                    "address": "xx-xx-xxxx,x - street, x - country",
                    "gender" : "male",
                    "url": "http://149.202.196.143:8000/live/djemal/djemal/592.ts"
            },
            {
                    "id": "c201",
                    "name": "Johnny Depp",
                    "email": "johnny_depp@gmail.com",
                    "address": "xx-xx-xxxx,x - street, x - country",
                    "gender" : "male",
                    "url":"http://149.202.196.143:8000/live/djemal/djemal/592.ts" 
            },
            {
                    "id": "c202",
                    "name": "Leonardo Dicaprio",
                    "email": "leonardo_dicaprio@gmail.com",
                    "address": "xx-xx-xxxx,x - street, x - country",
                    "gender" : "male",
    "url":"http://149.202.196.143:8000/live/djemal/djemal/592.ts" 
            }
        ]
    }
';
 
     
    