编辑代码

<?php
class orcode {
    public $token = 'C1eWgtN/ZOJ=qw2TXyhxjV+0SlUL35R6ri9G4uamPfQpK78AdHbBczFnYEskMDIvo';
    public $token_arr;

    function __construct() {
        $this->token_arr = str_split($this->token, 1);
    }
    public function or_encode($str){
        $str_arr = str_split($str, 1);
        $newstr = '';
        foreach ($str_arr as $pt) {
            if (in_array($pt, $this->token_arr)) {
                $thekey = array_search($pt, $this->token_arr, TRUE);
                $newpt = $this->token_arr[64-$thekey];
                $newstr .= $newpt;
            }
        }
        return $newstr;
    }
}

//$return='{"shunt_type":"dynamic","bundleId":"com.mathbrain.sudoku","pici":"125","country":"else","active_day":0,"game_duration":0,"ecpm":0,"ad_num":0,"game_num":0,"game_revenue":0,"media_source":null,"campaign":null,"adset":null,"ad":null}';
//$result = base64_encode($return);
//$orcode = new \orcode();
//$result = $orcode->or_encode($result);
//echo $result;

$str='IAF=X5JfXdg6n6e7e6B62dsOeKC6q4pKZbp=qAeNel98X5/6nON6q57826eieK/Asph=goeNeOsCXDGfdbmLY5p3eKC6gPeNeOsCXDGfd49Gq5a6n6FtIDG82DmKeOvR';
$orcode = new \orcode();
$jsonstr = base64_decode($orcode->or_encode($str));
echo $jsonstr."\n";
$arr=json_decode($jsonstr, true);
print_r($arr);