RE: [PHP] adding key-> value pair to an array

2008-12-03 Thread Jencisson Tsu
haha,is funny, i like it. > Date: Wed, 3 Dec 2008 12:40:39 -0800 > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED]; php-general@lists.php.net > Subject: Re: [PHP] adding key-> value pair to an array > > > > > //you can get really stupid with this

Re: [PHP] adding key-> value pair to an array

2008-12-03 Thread Yeti
> > //you can get really stupid with this.. > ${false} = 'some string here'; > echo ${''}; > //echos some string here > I like stupid things -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] adding key-> value pair to an array

2008-12-03 Thread Nathan Rixham
Jim Lucas wrote: I don't think the above will work either, afaik php doesn't allow you to have variable names start with numbers. well debatable.. # $12 = 'value'; Parsing Error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' # $varname = 12;

Re: [PHP] adding key-> value pair to an array

2008-12-03 Thread Jim Lucas
Aniketto wrote: > Hi all, > Can anybody tell me how can I add key->value pair in an array. > My code is as follows > > $criteria = array(); > $criteria['mail_subject'] = $form->subject->getValue(); > $criteria['delivery_user_name'] = $form->delivery_user_name->getValue(); > $criteria['start_da

Re: [PHP] adding key-> value pair to an array

2008-12-03 Thread Jim Lucas
Yeti wrote: >> //for each row I want to add percentage as new key->value pair >> // but it gives error 'Undefined variable: >> percentage' >>$row->$percentage = ($browseCount / $totalCount ) * 100; > > Obviously you get the error because $percentage is not d

Re: [PHP] adding key-> value pair to an array

2008-12-03 Thread Yeti
> //for each row I want to add percentage as new key->value pair > // but it gives error 'Undefined variable: > percentage' >$row->$percentage = ($browseCount / $totalCount ) * 100; Obviously you get the error because $percentage is not defined .. I did not

[PHP] adding key-> value pair to an array

2008-12-03 Thread Aniketto
Hi all, Can anybody tell me how can I add key->value pair in an array. My code is as follows $criteria = array(); $criteria['mail_subject'] = $form->subject->getValue(); $criteria['delivery_user_name'] = $form->delivery_user_name->getValue(); $criteria['start_date'] = $form->start_date->getVa

[PHP] adding key-> value pair to an array

2008-12-03 Thread Aniketto
Hi all, Can anybody tell me how can I add key->value pair in an array. My code is as follows $criteria = array(); $criteria['mail_subject'] = $form->subject->getValue(); $criteria['delivery_user_name'] = $form->delivery_user_name->getValue(); $criteria['start_date'] = $form->start_date->getVa