Ahem... So you want to have a two dimensional variable?

<?
$Array = array("110", "220"); // You array to add to $TwoDimensional
array
$TwoDimensional = array(); // Define $TwoDimensional to be an array
$TwoDimensional[0] = $Array; // Insert values from $Array to
$TwoDimensional
print "Var: ".$TwoDimensional[0][0]."<br><br>"; 
?>


Is this what you are looking for?


Niklas

-----Original Message-----
From: Andy [mailto:[EMAIL PROTECTED]] 
Sent: 5. helmikuuta 2002 12:54
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Tricky array question


This was just an error in my explenation I ment categories.

Meanwhile I tryed var vars, but it does not work for any reason?!?!?

My code looks like:

 $field = $categories[0]."[0]";
 echo $field;                            // returns glacier[0]
 echo 'var '.$$field.'<br>';     // returns bluddy nothing
 echo $categories[0];             // returns  glacier
 echo $glacier[0];                // returns 110

Does anybody know how to get the 110 out of the array?????

Thanx for any help,

Andy



"Niklas lampén" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
008101c1ae2d$a9df7580$ba93c5c3@Niklas">news:008101c1ae2d$a9df7580$ba93c5c3@Niklas...
> It should be $category[0] = $glacier;
>                             ^--- ERROR in you code
>
>
> Niklas
>
>
> -----Original Message-----
> From: Andy [mailto:[EMAIL PROTECTED]]
> Sent: 5. helmikuuta 2002 11:59
> To: [EMAIL PROTECTED]
> Subject: [PHP] Tricky array question
>
>
> Hi there,
>
> I have a tricky array question.
>
> My app is passing via post a array variable called glacier. Now I am 
> checking for the content of this array. Because there are more of 
> those arrays, I am getting all the names out of a db.
>
> How is it possible to get the value and keep the name of the array 
> dynamic?
>
> e.g:
> Array name passed by post is:                                 $glacier
> //
> contains e.g. $glacier[0] = testname
> Array with category names coming out of db is:   $category // contains
> e.g.
> $category[0] = glacier
>
>  echo $categories[0]; // returns glacier
>  echo $glacier[0];      // returns testname
>
> I tryed $categories[0][0] but it returns only the first letter of 
> glacier
> (g)
>
> Any ideas??
>
> Thanx, Andy
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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


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

Reply via email to