The following PHP to view the current variable type background, procedures and solutions are written out for everyone, as follows:
Solve the background
Toss process one:
Resolved the JSON Json_decode in PHP does not work without any output
Period, you need to understand one:
Copy Code code as follows:
Curl_exec returns the type of variable $respjson and is not a string type.
Toss process two:
1. Search:
Copy Code code as follows:
Reference:
Php:gettype–manual
Php:is_string–manual
Php:is_int–manual
So go and try:
Copy Code code as follows:
$respJson = $crifanLib->geturlresphtml ($GETTOKENURL);
$crifanLib->logwrite ("respjson=%s", $respJson);
Echo GetType ($respJson);
echo is_string ($respJson);
echo "Before Decodedjsonobj";
$DECODEDJSONOBJ = Json_decode ($respJson);
Results:
There is no output ...
2. Try:
Copy Code code as follows:
Echo GetType ($respJson);
echo is_string ($respJson);
Results:
Copy Code code as follows:
That proves that the type of the variable here is indeed string.
Summarize
The type of variable obtained in PHP is GetType ($var);
Individual judgments are of some type and can be used:
Copy Code code as follows:
Wait a minute.
The above is for PHP to view the current variable types of methods, I hope you like.