Re: Assigns True but not false?
| From: | Andy Pieters | Date: | Tue, 06 Dec 2005 21:33:55 +0000 |
| Subject: | Re: Assigns True but not false? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-226994@lists.php.net to get a copy of this message | ||
On Tuesday 06 December 2005 17:38, Gabe wrote:
> $this->m_arrQuesInfo[$this->m_itemID]['blnVacPromo'] = ( (
> !empty($_POST['vac_promo']) ) && ( $_POST['vac_promo'] ==
> 'on' ) ) ?
> TRUE : FALSE;
I have a habit of casting true or false to boolean so that I'm sure they're
not interpreted as 1 or 0.
Try this
$this->m_arrQuesInfo[$this->m_itemID]['blnVacPromo'] = ( (
!empty($_POST['vac_promo']) ) && ( $_POST['vac_promo'] ==
'on' ) ) ?
(bool) true:(bool) false;
HTH
Andy
--
Now listening to Whigfield - Saturday Night on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--
Attachment: [application/pgp-signature]
Attachment: [application/pgp-signature]