Topic awaiting preservation: PHP - convert multidimensional array to associative array easily? |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 10-17-2005 06:44
I have an array returned as result of a SQL query, but I need to feed the contents of that array to a preg_match() function. So, I need to convert it to an associative array, and I'm curious to know if there is an easier way to do that. Currently, I use a WHILE loop using mysql_fetch_array and just build an array from that. |
Maniac (V) Inmate From: Sthlm, Sweden |
posted 10-17-2005 14:44
How does your query look like? |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 10-17-2005 15:41
Basically, I have two associative arrays that I use in some preg_replace statements. They look like this: |
Maniac (V) Inmate From: Sthlm, Sweden |
posted 10-17-2005 20:49
I'm sort of getting what you need out of this, but not quite... |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 10-18-2005 06:37
Nope - the 'bad' city names are from data I'm scrapping. Not much I can do about it. And, the list of bad cities is growing. |
Maniac (V) Inmate From: Sthlm, Sweden |
posted 10-18-2005 10:54
Sorry, a no can do on the suggest thingie, company code... |