/**
 * @param string $data Json 字符串
 * @param bool   $assoc 是否返回关联数组
 * @return bool|array 成功返回转换后的数组,否则返回 false
 */
function isJson($data = '', $assoc = false) {
    $data = json_decode($data, $assoc);
    if (is_array($data) && !empty(current($data))) {
        return $data;
    }
    return false;
}如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
 支付宝打赏
支付宝打赏
      微信打赏
微信打赏
     
txttool.com 说一段 esp56物联 查询128 IP查询