⊗ppPmCdVC 71 of 447 menu

Comparison of Variables in PHP

In the examples above, we compared a variable with some number. But nothing prevents us from comparing two variables.

See the example:

<?php $test1 = 1; $test2 = 2; if ($test2 > $test1) { echo '+++'; // this will work, because $test2 is greater than $test1 } else { echo '---'; } ?>

Given the variables $test1 and $test2. Check which value of these variables is greater and display the corresponding message on the screen.

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