Home  >  Article  >  Backend Development  >  PHP4 Practical Application Experience Chapter 9_PHP Tutorial

PHP4 Practical Application Experience Chapter 9_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:30:18890browse

Author: Sun Movement
“===” operator
--------------------------
We have already mentioned it above , PHP4 adds a new === operator to test whether variables have the same type. Here's an example:
------------------------------------------------ -----------------------------------------------
if (!$ submit)
{
// If $submit does not exist, it implies that the form has not been submitted yet
// So the first page is displayed
?>



td {font-family: Arial;}







Please enter any value or data







Please enter some more values ​​or data















}
else
{
// If $submit does exist, the form has been submitted
// So use the following code to process
if ($yin === $yang)
{
$result = "The two variable values ​​and types are exactly the same";
}
else
{
$result = "The values ​​and types of the two variables are completely different";
}
?>








}
?>
----------------------------------------------- ----------------------------------
Select syntax
--------- ----------
PHP also supports a selection syntax for the various control structures discussed so far. For example, you can do this:
---------------------------------------- ----------------------------------------
if ( $elvis == 0)
{
echo "Elvis has left the building!";
}
else
{
echo "Elvis is still here!";
}
?>
Or you can do this:
if ($elvis == 0):
echo "Elvis has left the building!";
else :
echo "Elvis is still here!";
endif;
?>
-------------------------- -------------------------------------------------- ------
The second option is exactly the same as the first. In this structure, simply replace the first brace with a colon [:], remove the second brace, and use " endif" statement to end.
These are the contents of the second part. Next time, we'll bring you loops, arrays, and more forms - so don't miss it!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/509180.htmlTechArticleAuthor: Sun Movement "===" Operator------------- ----------- As we mentioned above, PHP4 added a new === operator to test whether variables have the same type. This...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn