You are here: RE: [PHP] alternative to empty « PHP « IT news, forums, messages
RE: [PHP] alternative to empty

Posted by "yanghshiqi" on 07/07/05 11:43

May be you can try (string)$string or (int)$string (seemed a little
strange).
Any way Ross, we need to see ur code to determine your problem.




Best regards,
Shiqi Yang
-----Original Message-----
From: Philip Hallstrom [mailto:php@philip.pjkh.com]
Sent: Thursday, July 07, 2005 12:15 AM
To: Dan Rossi
Cc: Ross; php-general@lists.php.net
Subject: Re: [PHP] alternative to empty

>> I have been using empty in forms for some time now. but have just
>> discovered
>> that
>>
>> PHP 4 As of PHP 4, The string value "0" is considered empty.
>
> If ($string == '') ??

Careful... notice the differenec b/n == and ===....

<?php
$s = 0;
if ($s == '') {
print("==\n");
}

if ($s === '') {
print("===\n");
}
?>

% php foo.php
==
%

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация