How to pass a parameter in a GET verb when using xdebug - NetBeans

1

I have a mySite.com/api/v1/listUsers.json.php page that will return a list of users to be consumed in an app. However I would like to take advantage of this same page and create the following condition for development personnel: if a variable is sent AND the value of this variable is equal to "arr" the response will be an array. Only for developers to quickly see the values in the user table.

Exemplo: mySite.com/api/v1/listUsers.json.php?type=arr .

For some reason it is not working. I'm trying to debug with xdebug but I'm not sure how to pass the type = arr parameter to be debugged.

I'm using xdebug in Netbeans.

How do I do this?

    
asked by anonymous 30.10.2016 / 20:35

1 answer

0

Could put a piece of code to evaluate. But basically it would be something like:

<?php
if(isset($_GET['type']) && 'arr' === $_GET['type']) {
    return $jsonInArrayFormat; // Retorna o json no formato de array
}

return $jsonDefault; // Retorna o json comum
    
12.03.2017 / 18:14