Here is my code(most code from Google\'s API page).
To reload the markers, when you create then, push them to an array.
Then create a function where you iterate through the array, setting the markers map as null. After this, erase the array.
Edit: I will assume, you gonna return a JSON with the following structure on your PHP
{
beaches: [
[
"Bondi Beach",
-12.890542,
120.274856,
4
],
[
"Other Beach",
-12.890542,
120.274856,
5
]
]
}
I'm also assumming you gonna use jQuery (just to simplify the ajax call and json iteration)
Basically, now, every 5 secs your javascript do an ajax request to your php, your php will return an updated json with the new beaches, you will remove the old markers, fill the array with the new locations and generate the new markers.