Created
June 6, 2019 11:15
-
-
Save ennjoy/b44855f0c462d9d7267cbc6c874bd1cf to your computer and use it in GitHub Desktop.
fields params for get
This file contains 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 | |
$fields = $_GET['fields']; | |
$fexp = explode(',', $fields); | |
$fname = array(); | |
foreach ($fexp as $key => $value) { | |
$fname[$value] = $value; | |
} | |
if (!empty($fname['user_id'])) { | |
$result['user_id'] = $row['user_id']; | |
} | |
$response = array( | |
'response' => $result | |
); | |
echo json_encode($response); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment