[Joomla!] operator '===' in php

PHP’s === Operator enables you to compare or test variables for both equality and type. Refer below for example.

  1. $a = '10';
  2. $b = 10;
  3. //Returns true since both variable contains the same value..
  4. $res = ($str==$int);
  5. //Returns false since the two variables are not of the same type..
  6. $res = ($a===$b);
  7. ?>
---
mathhoang

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...