note 89929 added to language.types.intro
| From: | Anonymous at osu1 dot php dot net | Date: | Sun, 29 Mar 2009 16:21:03 +0000 |
| Subject: | note 89929 added to language.types.intro | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152583@lists.php.net to get a copy of this message | ||
This example provides a great opportunity to emphasize the newline issue as it relates to HTML
rendering.
<?php
$a_bool = TRUE; // a boolean
$a_str = "foo"; // a string
$a_str2 = 'foo'; // a string
$an_int = 12; // an integer
echo 'a_bool is a ';
echo gettype($a_bool);
echo '<br>';
echo 'a_str is a ';
echo gettype($a_str); // prints out: string
echo '<br>';
echo 'an_int is a ';
echo gettype($an_int); // prints out: string
echo '<br>';
// If this is an integer, increment it by four
if (is_int($an_int)) {
$an_int += 4;
echo "<br>integer: $an_int";
}
// If $bool is a string, print it out
// (does not print out anything)
if (is_string($a_bool)) {
echo "String: $a_bool";
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 72.208.135.183
----
Manual Page -- http://www.php.net/manual/en/language.types.intro.php
Edit -- https://master.php.net/note/edit/89929
Del: integrated -- https://master.php.net/note/delete/89929/integrated
Del: useless -- https://master.php.net/note/delete/89929/useless
Del: bad code -- https://master.php.net/note/delete/89929/bad+code
Del: spam -- https://master.php.net/note/delete/89929/spam
Del: non-english -- https://master.php.net/note/delete/89929/non-english
Del: in docs -- https://master.php.net/note/delete/89929/in+docs
Del: other reasons-- https://master.php.net/note/delete/89929
Reject -- https://master.php.net/note/reject/89929
Search -- https://master.php.net/manage/user-notes.php