Re: [PHP] Getting Numerical Index of a Key

2003-03-04 Thread Justin French
on 04/03/03 5:47 PM, Matt Honeycutt ([EMAIL PROTECTED]) wrote:

 I'm just going to spend the extra 5 minutes and rewrite that little
 chunk of code.

Sounds like the right move :)

Justin


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



[PHP] Getting Numerical Index of a Key

2003-03-03 Thread Matt Honeycutt
Is there an easy way to get the numerical index of a text key for an
array?  I don't see anything in the manual, but before I waste time
writing code to find this info, I thought I would double check here.
 
---Matt


Re: [PHP] Getting Numerical Index of a Key

2003-03-03 Thread Leif K-Brooks
What makes you think it HAS a numerical index?

Matt Honeycutt wrote:

Is there an easy way to get the numerical index of a text key for an
array?  I don't see anything in the manual, but before I waste time
writing code to find this info, I thought I would double check here.
---Matt

 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


RE: [PHP] Getting Numerical Index of a Key

2003-03-03 Thread Matt Honeycutt
Because I created it with mysql_fetch_array().  I know for a fact that
both keys exist, and I can look at the output and tell what text key
matches to what numerical key, but I don't want to hardcode it like
that.  The people that are taking over this code might change something
and screw everything up.

---Matt

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 04, 2003 12:35 AM
To: Matt Honeycutt
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Getting Numerical Index of a Key

What makes you think it HAS a numerical index?

Matt Honeycutt wrote:

Is there an easy way to get the numerical index of a text key for an
array?  I don't see anything in the manual, but before I waste time
writing code to find this info, I thought I would double check here.
 
---Matt

  


-- 
The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent
of the law.




-- 
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



Re: [PHP] Getting Numerical Index of a Key

2003-03-03 Thread Leif K-Brooks
No, there's no easy way to do this.  Just out of curiousity, why do you 
want to do this anyway?

Matt Honeycutt wrote:

Because I created it with mysql_fetch_array().  I know for a fact that
both keys exist, and I can look at the output and tell what text key
matches to what numerical key, but I don't want to hardcode it like
that.  The people that are taking over this code might change something
and screw everything up.
---Matt

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 04, 2003 12:35 AM
To: Matt Honeycutt
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Getting Numerical Index of a Key

What makes you think it HAS a numerical index?

Matt Honeycutt wrote:

 

Is there an easy way to get the numerical index of a text key for an
array?  I don't see anything in the manual, but before I waste time
writing code to find this info, I thought I would double check here.
---Matt



   

 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.



RE: [PHP] Getting Numerical Index of a Key

2003-03-03 Thread Matt Honeycutt
Bad design, basically.

This script is creating the array, then modifying a certain value in it
using the text key.  Later, it's referring to each value in the array by
numerical index.  Apparently, the text key and the numerical index do
not refer to the same values in PHP, so the value it's referring to with
the numerical index is the original value, not the one that was
modified.

I'm just going to spend the extra 5 minutes and rewrite that little
chunk of code.

---Matt

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 04, 2003 12:39 AM
To: Matt Honeycutt
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Getting Numerical Index of a Key

No, there's no easy way to do this.  Just out of curiousity, why do you 
want to do this anyway?

Matt Honeycutt wrote:

Because I created it with mysql_fetch_array().  I know for a fact that
both keys exist, and I can look at the output and tell what text key
matches to what numerical key, but I don't want to hardcode it like
that.  The people that are taking over this code might change something
and screw everything up.

---Matt

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 04, 2003 12:35 AM
To: Matt Honeycutt
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Getting Numerical Index of a Key

What makes you think it HAS a numerical index?

Matt Honeycutt wrote:

  

Is there an easy way to get the numerical index of a text key for an
array?  I don't see anything in the manual, but before I waste time
writing code to find this info, I thought I would double check here.

---Matt

 




  


-- 
The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent
of the law.




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