Skip to content

Instantly share code, notes, and snippets.

@ennjoy
Created June 6, 2019 11:15
Show Gist options
  • Save ennjoy/b44855f0c462d9d7267cbc6c874bd1cf to your computer and use it in GitHub Desktop.
Save ennjoy/b44855f0c462d9d7267cbc6c874bd1cf to your computer and use it in GitHub Desktop.
fields params for get
<?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