$data=$this->user->get(); //is obj
$data=(string)$data; //is string
$data=$data->toArray(); //is array
$data=$data->toJson(); //is string(json)
//数据强制转换
$str;
return (array)$str;
return (int)$str;
return (string)$str;
return (bool)$str;
$data=$this->user->get(); //is obj
$data=(string)$data; //is string
$data=$data->toArray(); //is array
$data=$data->toJson(); //is string(json)
//数据强制转换
$str;
return (array)$str;
return (int)$str;
return (string)$str;
return (bool)$str;
转载于:https://www.cnblogs.com/docter/p/6160257.html