XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).
Moderator: General Moderators
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Thu Feb 10, 2005 7:56 am
i have for exampel an array :
array =
'23368': array =
makat: string = "23368"
qnt: string = "6.00"
weight: string = "44.40"
date: long = 1107900000
'24651': array =
makat: string = "24651"
qnt: string = "6.00"
weight: string = "26.64"
date: long = 1107900000
when i try to access this arrat that's called arr1["23368"] i get undefined!
why is that? isnt this both are strings?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Feb 10, 2005 8:09 am
uhm, you know this is a php board right?
Moved to Misc.
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Thu Feb 10, 2005 8:29 am
what seem's to be the problem
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Feb 10, 2005 8:34 am
first off, what language is this? It's obviously not php. Second, I don't see arr1 mentioned anywhere in that "code"
n00b Saibot
DevNet Resident
Posts: 1452 Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:
Post
by n00b Saibot » Thu Feb 10, 2005 9:21 am
i think he has tried to give an
'exampel' of var_dump output of his array!
right pelegk2!
I tried this in a snippet. i think his array maybe like this
Code: Select all
$arr =
array(
'23368'=>
array(makat=>"23368",
qnt=>"6.00",
weight=>"44.40",
date=>1107900000
)
,
'24651'=>
array(makat=>"24651",
qnt=>"6.00",
weight=>"26.64",
date=>1107900000
)
)
);
which produces
Code: Select all
array(2) {
ї23368]=>
array(4) {
ї"makat"]=>
string(5) "23368"
ї"qnt"]=>
string(4) "6.00"
ї"weight"]=>
string(5) "44.40"
ї"date"]=>
int(1107900000)
}
ї24651]=>
array(4) {
ї"makat"]=>
string(5) "24651"
ї"qnt"]=>
string(4) "6.00"
ї"weight"]=>
string(5) "26.64"
ї"date"]=>
int(1107900000)
}
}
..and I am able to get correct values by using $arr['23368'][makat] which gives correct output > 23368.
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Sun Feb 13, 2005 1:04 am
that an output i havre copied from th immediate window
and i wanted to show an array i could'nt access
i will try try [23368] thing (the number as a number and not as a string ['23368']