mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
copy from is_string example,
more descriptive example code output -- Provided by Hans Henrik Bergan (divinity76@gmail.com) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329668 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
65ecfa33fd
commit
73c3254151
1 changed files with 14 additions and 13 deletions
|
@ -53,26 +53,27 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (is_int(23)) {
|
||||
echo "is integer\n";
|
||||
} else {
|
||||
echo "is not an integer\n";
|
||||
$values = array(23, "23", 23.5, "23.5", null, true, false);
|
||||
foreach ($values as $value) {
|
||||
echo "is_int(";
|
||||
var_export($value);
|
||||
echo ") = ";
|
||||
var_dump(is_int($value));
|
||||
}
|
||||
var_dump(is_int(23));
|
||||
var_dump(is_int("23"));
|
||||
var_dump(is_int(23.5));
|
||||
var_dump(is_int(true));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
is integer
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
is_int(23) = bool(true)
|
||||
is_int('23') = bool(false)
|
||||
is_int(23.5) = bool(false)
|
||||
is_int('23.5') = bool(false)
|
||||
is_int(NULL) = bool(false)
|
||||
is_int(true) = bool(false)
|
||||
is_int(false) = bool(false)
|
||||
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue