Re: variable hell

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mario wrote:
Hi all

I have few variables in this format:

$isproductssorttext = "150";
$isofferssorttext = "250";
$isnewproductssorttext = "350";

$isproductscount = "50";
$isofferscount = "30";
$isnewproductscount = "20";
etc....


What I want to do is have a variable e.g. $x = "products";

and create from that, the variable $is'products'sorttext
(<--$isproductssorttext) and use its value

so if $x was "offers" on echo I would have (250) <-- "$isofferssorttext"
if $x was newproducts on echo I would have (350) <-- "$isnewproductssorttext"


Thanks in advance

Mario


You probably want to look into arrays...

http://us4.php.net/manual/en/language.types.array.php
http://us4.php.net/array

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@xxxxxxxxxxxx

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux