Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'db.php';
- $arrayData = json_decode($_POST['arrayData'], true);
- //echo "\n" . displayRecursiveResults($arrayData) . "\n";
- $playerID = $arrayData['uid'];
- if(!isset($playerID)){
- echo "Fail data";
- exit;
- }
- else {
- GetValue($playerID);
- }
- function displayRecursiveResults($arrayObject) {
- foreach($arrayObject as $key=>$data) {
- if(is_array($data)) {
- displayRecursiveResults($data);
- } elseif(is_object($data)) {
- displayRecursiveResults($data);
- } else {
- echo $key." => ".$data."\n";
- }
- }
- }
- function GetValue($playerID) {
- $user_data = R::findOne('users', 'UID = ?', [$playerID]);
- if (isset($user_data)) {
- $array = $user_data->export();
- echo json_encode($array);
- }
- else {
- echo "Not find this user";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment