⊗ppPmCdIs 87 of 447 menu

Isset Command in PHP

Let us have the following variable:

<?php $test = null; ?>

Let's write a condition that checks that the variable is not equal to null:

<?php $test = null; if ($test !== null) { echo '+++'; } else { echo '---'; } ?>

Such a check can be performed more conveniently using a special command isset:

<?php $test = null; if (isset($test)) { echo '+++'; } else { echo '---'; } ?>

You can perform the reverse check, that the variable is not defined. To do this, we will perform inversion of isset using the logical NOT:

<?php $test = null; if (!isset($test)) { echo '+++'; } else { echo '---'; } ?>

Modify the following code according to the studied theory:

<?php $test = null; if ($test == null) { echo '+++'; } else { echo '---'; } ?>

Modify the following code according to the studied theory:

<?php $test = null; if ($test != null) { echo '+++'; } 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