Youri LACAN-BARTLEY wrote:
Hi Jochem,
I meant overly-complicated in this specific context.
If each key of this array is going to contain only one value why not
reduce the array to something like this :
array(1) {
[1.2]=
array(2) {
[code]= string(3) 111
[status]= string(3)
Richard Lynch wrote:
On Fri, December 1, 2006 9:28 am, Ray Hauge wrote:
I forgot to mention that you won't be able to use 0, 1, etc. as
PHP
will convert those to integers. If you do use them, then they will
replace [0] with whatever you put in there, and if you are using the
references, it
2006/11/30, Brian Dunning [EMAIL PROTECTED]:
var_dump() gives me this:
array(1) {
[1.2]=
array(2) {
[code]=
array(1) {
[0]=
string(3) 111
}
[status]=
array(1) {
[0]=
string(3) new
}
}
}
I'm trying to set a variable to that
Well, I've only just fallen out of bed, but I'd say you'd be able to
access it via $var[0][0][0] as in $var[1.2][code][0] to change 111
to something else and $var[1.2][status][0] to set/change new.
I must say this looks like an overly complicated array for what it
serves. A little OOP could come
Youri LACAN-BARTLEY wrote:
Well, I've only just fallen out of bed, but I'd say you'd be able to
access it via $var[0][0][0] as in $var[1.2][code][0] to change 111
to something else and $var[1.2][status][0] to set/change new.
I must say this looks like an overly complicated array for what it
That seems right to me too - but everything I try returns NULL. I set
$try=$var[0], and $try ends up being null; print_r($try) gives blank.
I even tried $try=$var[1] and it was the same result. Am I in the
Twilight Zone?
On Dec 1, 2006, at 12:26 AM, Youri LACAN-BARTLEY wrote:
-BEGIN
Try
$try = $var[1.2];
If your array looks like the one below then there is no $var[0] and
therefore you get NULL
/Thunis
Brian Dunning skrev:
That seems right to me too - but everything I try returns NULL. I set
$try=$var[0], and $try ends up being null; print_r($try) gives blank.
I even
Hi Jochem,
I meant overly-complicated in this specific context.
If each key of this array is going to contain only one value why not
reduce the array to something like this :
array(1) {
[1.2]=
array(2) {
[code]= string(3) 111
[status]= string(3) new
}
}
That's all I was referring
That works, but the value 1.2 is unknown, I can't hardcode it.
On Dec 1, 2006, at 6:52 AM, Fredrik Thunberg wrote:
Try
$try = $var[1.2];
If your array looks like the one below then there is no $var[0] and
therefore you get NULL
/Thunis
Brian Dunning skrev:
That seems right to me too -
-Original Message-
From: Fredrik Thunberg [mailto:[EMAIL PROTECTED]
Sent: Friday, December 01, 2006 8:52 AM
To: Brian Dunning; php-general@lists.php.net
Subject: Re: [PHP] EZ array problem - What's wrong with my brain?
Try
$try = $var[1.2];
If your array looks like the one below
Development Lead
American Student Loan Services
www.americanstudentloan.com
-Original Message-
From: Ray Hauge
Sent: Friday, December 01, 2006 9:21 AM
To: Fredrik Thunberg; Brian Dunning; php-general@lists.php.net
Subject: RE: [PHP] EZ array problem - What's wrong with my brain?
http
Well if the key of your array is unknown, you could always gather the
key names with array_keys() and fiddle something from there or just
change the structure of you array to be more adapted to you needed or
use what Ray just proposed in another post concerning references and the
creation of a
There is no $var[0];
It's $var['1.2];
There is no $var[0][0];
It's $var['1.2']['code'];
The remainder of this email composition is left as an exercise for the
reader.
On Fri, December 1, 2006 8:46 am, Brian Dunning wrote:
That seems right to me too - but everything I try returns NULL. I set
On Fri, December 1, 2006 9:28 am, Ray Hauge wrote:
I forgot to mention that you won't be able to use 0, 1, etc. as
PHP
will convert those to integers. If you do use them, then they will
replace [0] with whatever you put in there, and if you are using the
references, it will replace both
var_dump() gives me this:
array(1) {
[1.2]=
array(2) {
[code]=
array(1) {
[0]=
string(3) 111
}
[status]=
array(1) {
[0]=
string(3) new
}
}
}
I'm trying to set a variable to that 1.2. Shouldn't I be able to
get it with $var = $arr[0][0]?
15 matches
Mail list logo