php3-list | 199903
Date: 03/31/99
- Next message: Chad Cunningham: "Re: [PHP3] Array Question"
- Previous message: Jason Brooke: "Re: [PHP3] Help, lost in the mixture of php3 and html....."
- In reply to: Steve Douville: "[PHP3] Array Question"
- Next in thread: Chad Cunningham: "Re: [PHP3] Array Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> Okay...how do I do this:
>
> $a=1;
> $b="c";
> $c="g8dh";
>
> I want to send these variables (only more) to a class to be
> processed. but I
> want to send them as an array and then break them out and be able to
> recognize the key,value pairs. I know that I can implode them,
> put them into
> the array, and explode them from the array. But then how do I keep the
> variable names?
>
There's prob a waaay better way to do this...
Not sure how you'd dynamically load the array though. I kinda invented this
so if there is a better way I'm all ears. Always learning...
$array[] = array("var"=>"a", "value"=>1);
$array[] = array("var"=>"b", "value"=>"c");
$array[] = array("var"=>"c", "value"=>"g8dh");
//Then pass the array be reference &$array
//then slurp it out again...
while (list($tmp,$tmparray) = each($array)) {
// $tmp is the array number
${$tmparray["var"]} = $tmparray["value"];
}
echo $c;
Cheers,
Graeme
-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev-list-admin <email protected>
- Next message: Chad Cunningham: "Re: [PHP3] Array Question"
- Previous message: Jason Brooke: "Re: [PHP3] Help, lost in the mixture of php3 and html....."
- In reply to: Steve Douville: "[PHP3] Array Question"
- Next in thread: Chad Cunningham: "Re: [PHP3] Array Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

