search

Home  >  Q&A  >  body text

Why can the is series of functions only use the var_dump function to display the data type, but not echo?

<?php

$name=123;

//Use the is series function to test whether the variable $name is an integer type

echo is_int($name) ;

$ss=false;

var_dump(is_bool($ss));

?>

非凡非凡2074 days ago1098

reply all(2)I'll reply

  • 查无此人

    查无此人2019-03-25 17:12:57

    echo is the output value.

    var_dump is the type of printed value.

    false, use echo to output, there is no value, so you can’t see the output. You can print the type with var_dump. Each variable has a type, so you can see the printed result.

    reply
    2
  • Cancelreply