query($sql); $rowset = $result -> fetchAll(PDO::FETCH_ASSOC); if(isset($rowset[0]['PROPERTY'])){ $ifgps ='1'; $position = get_position($rowset[0]['PROPERTY']); $j = $position['j']; $w = $position['w']; $speed = $position['speed']; }else{ $ifgps ='0'; $j = '0'; $w = '0'; $speed = '0'; } $signPackage = $jssdk->GetSignPackage($url); $signPackage['j'] =$j; $signPackage['w'] =$w; $signPackage['speed'] =$speed; $signPackage['ifgps'] =$ifgps; echo json_encode($signPackage);