php foreach array key name





places records->resultarray() places[name] site[name] foreach(places as place) .?php endforeach ?> Also when I run a test which just spits out the array this is the result, What I am trying to render is[Philadelphia]. | Recommendphp arrays, storing multiple values with the same key within foreach loop. imple pushes a city name (cityProx) into a single dimension array(validLocationCity) if the a given distance is less a given proximity distance(prox) if(actualDistance < prox) arraypush(validLocationCity As Pekka stated above. foreach (array as key > value). Also you might want to try a recursive function.1. Get root key name of an array in PHP. Hey Im trying to get the key of my array in a foreach. But got this error Warning: arraykeys() expects parameter 1 to be array, string given on line 10.No need any function to get those.