DISCOVERING THE WORLD ONE SEESMIC AT A TIME!
14 Jan
If any of you out there have a bit of experience with php (any experience is more than mine), could you leave a note in the comments.
Basically what I am doing is this:
To plot these posts on Google Maps, I am using $post_title and $post_content. I can pull those out of the database fine. The problem arises when I have two posts with the same title. When that happens Google Maps (because the lat/lons are the same) is only displaying one of the duplicates.
I need to loop through the query results, find duplicates, and combine the content so that there is only one entry per location.
Help.
4 Responses for "I need some PHP assistance"
Hi, critter!
you can create a array and then use the title as a key:
$arrayOfContents) {
}
?>
I can’t direct message you
Bye,
Lucas
Hi, critter!
you can create a array and then use the title as a key:
$combine = array();
{ // the loop begins
if (!array_key_exists($title, $combine)) {
$combine[ $title ] = array();
}
$combine[ $title ][] = $content;
} // the loop ends
// So, you can iterate through it
foreach($combine as $title => $arrayOfContents) {
}
I can’t direct message you
Bye,
Lucas
Hey Critter, saw your post… haven’t played with PHP in a while but based on what you describe… I think this might help: http://www.paxer.info/scripts/view.php?script=locations/locations.php
Hope it helps.. Cheers.
Thanks all. I was able to get it sorted.
Leave a reply