scriptygoddess

22 Sep, 2004

Expression values

Posted by: Jennifer In: Bookmarks

PHP type comparison tables

For example if $x=""; what will empty($x) return? or is_null($x)? Or the even more surprising one: $x = "0" will return TRUE on empty() even though it is considered a string.

Related posts:

  1. Adding a block of HTML to a WordPress post One problem with the WYSIWYG editor in WordPress is that...

Related posts brought to you by Yet Another Related Posts Plugin.

2 Responses to "Expression values"

1 | Mark J

September 22nd, 2004 at 7:59 pm

Avatar

Very tricky stuff… don't even get me started on the triple equals… if ($x === 1)

2 | michel

September 23rd, 2004 at 6:28 pm

Avatar

This is why empty() blows and why it should be avoided.
(And why checking the data type is most usually a good idea if you need accurate results!)

Featured Sponsors


  • Michael: You can use get_header(2) in your case. The filename of your custom header has to be header-2.php. The problem with include(your_file.php) is, all
  • cliff: hi wonder if you can help me, pls i designed www.kouga.mobi using dreamweaver CS3 and now want to make the phonenumbers into links so that if you
  • jerey: how do i rewrite this because it tried RewriteEngine on #Options +FollowSymlinks RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FIL

About


Advertisements