Special welcome gift. Get 50% off your first courses with code “AS50”. Find out more!

HomeInterviewWrite a statement to show the joining of multiple comparisons in PHP?
about us new 2

Write a statement to show the joining of multiple comparisons in PHP?

PHP allows multiple comparisons to be grouped together to determine the condition of the statement. It can be done by using the following syntax:

comparison1 and|or|xor comparison2 and|or|xor comparison3 and|or|xor.

The operators that are used with comparisons are as follows:

1. and: result in positive when both comparisons are true.
2. or: result in positive when one of the comparisons or both of the comparisons are true.
3. xor: result in positive when one of the comparisons is true but not both of the comparisons.

Example:

$resCity == “Reno” or $resState == “NV” and $name == “Sally”

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

Categories

ads sidebar 1

You May Also Like

Oracle has several modes for shutting down the database: In normal mode, the database is shut down by default. It...
Materialized views are items that contain condensed sets of data from base tables that have been summarized, clustered, or aggregated. They...
Every database in Oracle has a tablespace called SYSTEM, which is generated automatically when the database is created. It also...