How to pass a parameter in a GET verb when using Xdebug - Netbeans

Asked

Viewed 28 times

1

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

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

For some reason it’s not working. I’m trying to debug with Xdebug but I don’t know how to pass the type=arr parameter to be debugged.

I am using Xdebug in Netbeans.

How do I do that?

1 answer

0

You could put in a piece of code for us 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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.