daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Dec 18th, 2017 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function custom_json_decode($json)
  2. {
  3.     $comment = false;
  4.     $out = '$x=';
  5.     for ($i=0; $i<strlen($json); $i++) {
  6.          if (!$comment) {
  7.              if (($json[$i] == '{') || ($json[$i] == '[')) $out .= ' array('; else if (($json[$i] == '}') || ($json[$i] == ']')) $out .= ')'; else if ($json[$i] == ':') $out .= '=>';
  8.     else
  9.     $out .= $json[$i];
  10.     }
  11.     else
  12.     $out .= $json[$i];
  13.     if ($json[$i] == '"' && $json[($i-1)]!="\")
  14.     $comment = !$comment;
  15.     }
  16.     eval($out . ';');
  17.     return $x;
  18. }
  19.  
  20. custom_json_decode($data);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top