Det kan laves på mange måder, sådan f.eks. i javascript ud fra den aktuelle dato:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>Vis femte søndag</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
html,body{height:100%;margin:0px;border:0px;padding:0px;font-family:tahoma,verdana,arial,sans-serif;font-size:small;}
</style>
<script language="javascript" type="text/javascript">
window.onload = function(){
var nu = new Date();
var foerste = new Date(nu.getFullYear(),nu.getMonth(),1);
var sidste = new Date(nu.getFullYear(),nu.getMonth()+1,0);
if(sidste.getDate()-28>(7-foerste.getDay())%7){
div = document.getElementById('sondag5');
div.style.display = 'block';
div.firstChild.firstChild.firstChild.innerHTML = 'Sidste søndag i måneden er d. ' + (sidste.getDate()-sidste.getDay()) + ".";
}
alert(sidste+"\n"+foerste.getDay());
}
</script>
</head>
<body>
<table id="sondag1">
<tr>
<td>Søndag 1</td>
</tr>
</table>
<table id="sondag2">
<tr>
<td>Søndag 2</td>
</tr>
</table>
<table id="sondag3">
<tr>
<td>Søndag 3</td>
</tr>
</table>
<table id="sondag4">
<tr>
<td>Søndag 4</td>
</tr>
</table>
<table id="sondag5" style="display:none;">
<tr>
<td>Søndag 5</td>
</tr>
</table>
</body>
</html>
-- men vil det ikke være oplagt at lave det i din php-fil (eller med dit php-script angive de variabler, som bestemmer i ovenstående script !-)