Russell Jones wrote:
> lets say I have an array...
>
> $myArray = array (
>
> "firstkey" => "first val",
> "secondkey" => "second val"
>
> )
>
>
> Can I still call these by their numeric order? ie, echo $myArray[0] shoudl
> print out "first val"...
No, but you can do:
$myArrayNumeric = array
Anyway, as the replies already show, you have to have a key to identify the
record to be deleted, otherwise, I don't see there can be a way. Why don't
use the data as key as well?
Satyam
"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey,
> I have a $data_recs array li
$array = array(
'fruit1' => 'apple',
'fruit2' => 'orange',
'fruit3' => 'grape',
'fruit4' => 'apple',
'fruit5' => 'apple');
// this cycle echoes all associative array
// key where value equals "apple"
while ($fruit_name = current($array)) {
if ($fruit_name == 'apple') {
"René fournier" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a simple way to return the key (name) of one element in an
> array? I looked up key() in the docs, but there are no examples or
> notes...
key() will do it, but you have to have the internal pointer already on t
Hey John,
I guess you are right, I do rely on this list quite a bit but am not the
only one.
Am learning by my mistakes though and finding solutions...they may not be
the best solutions but they still work, everyone has to learn.
Thanks for replying to the question though. And i didnt know about th
Ryan A wrote:
I GOT IT
this is where the data was coming from:
and this is where i take the values and dump it into an array/variables that
i can call when and where i please:
$pppno)
{$asdf[$nn]=$pppno;
$nn++; }
?>
I just took out some of the breaks so it will take less space but y
Ryan A wrote:
Hi,
Thanks for replying.
I tried that and have 2 numbers like so:
and tried to echo it like so:
Echo of one is and echo of two is:
Echo of one is and echo of two is:
the output i got was:
**
32563Echo of one is 5 and echo of two is: 6
Echo of one is and echo of
Tuesday, July 29, 2003 11:59 PM
Subject: [PHP] Re: Simple Array question
> Normally array values start at 0 (zero), but let's say sh1=1 and sh2=2.
then
> you could echo the values out like this: echo "ID 1: $id[1]ID 2:
> $id[2]";
>
> Irvin.
> _
Hi,
Thanks for replying.
I tried that and have 2 numbers like so:
and tried to echo it like so:
Echo of one is and echo of two is:
Echo of one is and echo of two is:
the output i got was:
**
32563Echo of one is 5 and echo of two is: 6
Echo of one is and echo of two is:
**
Normally array values start at 0 (zero), but let's say sh1=1 and sh2=2. then
you could echo the values out like this: echo "ID 1: $id[1]ID 2:
$id[2]";
Irvin.
_
"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> If i am posting somethin
10 matches
Mail list logo