⊗ppPmCdDT 72 of 447 menu

Data Types and the If-Else Construct in PHP

When using the if construct, you can compare strings as well. For example, let the variable $test store some string, like this:

<?php $test = 'abc'; ?>

Let's check if the content of the variable $test is equal to the string 'abc':

<?php $test = 'abc'; if ($test == 'abc') { echo '+++'; // this will work, because the variable is equal to 'abc' } else { echo '---'; } ?>
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