⊗ppPmCdECh 69 of 447 menu

Equality Check in PHP

To check two values for equality, the operator == is used. Let's check for example, that the variable $test is equal to 0:

<?php $test = 0; // let the variable value be 0 if ($test == 0) { echo '+++'; // this will work, because the variable is equal to 0 } else { echo '---'; } ?>

Let's change the value of the variable so that the condition is not met:

<?php $test = 1; // let the variable value be 1 if ($test == 0) { echo '+++'; } else { echo '---'; // this will work, because the variable is NOT equal to 0 } ?>

Check that the variable $test is equal to 10.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline