NYCPHP Meetup

NYPHP.org

[nycphp-talk] Creating multidimensional arrays

Emmanuel. M. Decarie emm at scriptdigital.com
Wed May 14 13:48:19 EDT 2003


Hello Mike,

>Like yourself, I have been a big fan of multidimensional arrays (MDA) in
>PHP. One of my favorite uses is in using an MDA to hold product information
>or perhaps a special price which goes into effect if the correct "code" used
>in "unlocking" the array.  For example,
>
>consider an array like this
>
>promo[product_code][promo_code][domestic_price][foreign_price][source_code]
>
>and in PHP you build it like this
>
>$promo['abc']['123']=array('pdprice'=>167,'pfprice'=>197,'src_cde'=>'abc123'
>);
>
>You can see that the promo_code, '123' works as a key to unlocking the
>special pricing and source code that should be used on the order.  Any value
>for the promo_cde other than '123' and the value of pdprice will be null.

Ah that's nice. I used often this, but not in PHP, but with UserTalk, 
which is the scripting language for Frontier/Radio UserLand.

Cheers
-Emmanuel


______________________________________________________________________
Emmanuel Décarie / Programmation pour le Web - Programming for the Web
Radio UserLand/Frontier - Perl - PHP - Javascript  <http://scriptdigital.com/>
Blog: <http://blog.scriptdigital.com> - AIM: scriptdigital


-- 
______________________________________________________________________
Emmanuel Décarie / Programmation pour le Web - Programming for the Web
Radio UserLand/Frontier - Perl - PHP - Javascript  <http://scriptdigital.com/>
Blog: <http://blog.scriptdigital.com> - AIM: scriptdigital




More information about the talk mailing list