Good Afternoon all,
I am trying to work with arrays to display a list of school campuses within a given area after passing lat and lon in the url (?lat=43.19191&long=-72.2511).
Once I pull in their lat and lon I compare it against some database's and some algoritms to output the nearest campuses, but i'm having some trouble figuring out how to output it the way I want. This is what I WANT it to look like..
To accomplish something like this should I use associative arrays in my php code? perhaps something like this in my for loop:
Or am i better off using array objects of some sort?
Any advice is greatly appreciated! Thanks
I am trying to work with arrays to display a list of school campuses within a given area after passing lat and lon in the url (?lat=43.19191&long=-72.2511).
Once I pull in their lat and lon I compare it against some database's and some algoritms to output the nearest campuses, but i'm having some trouble figuring out how to output it the way I want. This is what I WANT it to look like..
Code:
[Schools]
[School]
[name = schoolNameHere]
[id = 125125121]
[/School]
[School]
[name = schoolNameHere]
[id = 215235]
[/School]
[School]
[name = schoolNameHere]
[id = 5322]
[/School]
[/Schools]
To accomplish something like this should I use associative arrays in my php code? perhaps something like this in my for loop:
Code:
$data['name'][$start] = $row['Name'];
Or am i better off using array objects of some sort?
Any advice is greatly appreciated! Thanks