![]() Topic awaiting preservation: PHP - convert multidimensional array to associative array easily? (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() 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 |
![]() How does your query look like? |
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() Basically, I have two associative arrays that I use in some preg_replace statements. They look like this: |
Maniac (V) Inmate From: Sthlm, Sweden |
![]() I'm sort of getting what you need out of this, but not quite... |
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() 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 |
![]() Sorry, a no can do on the suggest thingie, company code... |