Koder.uz

3 of 402 menu

PHP da isset buyrug'i

Faraz qilaylik, bizda quyidagi o‘zgaruvchi bor.: 

<?php $test = null; ?>

 Keling, o‘zgaruvchi null ga teng emasligini tekshiruvchi shart yozamiz: 

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

Bunday tekshiruvni qulayroq tarzda isset maxsus funksiyasi yordamida bajarish mumkin: 

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

uz ru
light night