0Basic uncle, a novice on the road, asking for advice on var_dump problem
本善之初
本善之初 2019-08-18 15:35:48
0
3
1213

$c = '33';

echo is_float($c);

This will not display the result

echo var_dump(is_float($c)) ;

This display is bool(false);

Don’t understand?

Shouldn’t the floating point confirm 33, and the original variable corresponding to 33 is consistent, should the returned value be 1 or true?

Seeking advice online~ Looking for another organization, looking for a big hug~

本善之初
本善之初

reply all(3)
殘留の回憶

echo can only output string, integer and int floating point data. Composite and resource-type data cannot be printed;

You have used is_float, and the result is Boolean, so naturally the result cannot be produced.

var_dump can print arrays, objects and other composite variables and Any other type of data.

V

$c = '33';This is a string.

echo outputs variables and strings;

var_dump outputs variable type, variable length and variable value;


本善之初

Does floating point float only correspond to data with decimal points?

Because I added a decimal point to the variable, the conversion judgment was correct~

Please answer~~~

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template