Home >Backend Development >PHP Tutorial >PHP查看当前变量类型的方法_PHP

PHP查看当前变量类型的方法_PHP

WBOY
WBOYOriginal
2016-05-30 08:47:221112browse

下面把PHP查看当前变量类型的背景、过程以及解决方案都给大家写整理出来了,具体如下:

解决背景

折腾过程一:

代码如下:


PHP: curl_exec – Manual

代码如下:


php check variable type

参考:

代码如下:


$respJson = $crifanLib->getUrlRespHtml($getTokenUrl);
$crifanLib->logWrite("respJson=%s", $respJson);
echo gettype($respJson);
echo is_string($respJson);
echo "before decodedJsonObj";
$decodedJsonObj = json_decode($respJson);


结果:

代码如下:


echo gettype($respJson);
echo is_string($respJson);


结果:

代码如下:


输出:string1

代码如下:


is_int
is_string

等等。

以上就是针对PHP查看当前变量类型的方法,希望大家喜欢。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn