hi i am currently converting one of my sites to php some of the functions are stilljavascript heres one
[code]
Date.prototype.toDateString = function () {return [this.getDate(), [‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, ‘Jul’, ‘Aug’, ‘Sep’,’Oct’, ‘Nov’, ‘Dec’] [this.getMonth()], this.getFullYear()].join(‘ ‘)}
daysOfNote = new Object();
daysOfNote[‘1 Jan’] = ‘Blah Blah’;
…
daysOfNote[’31 Jan’] = ‘Foo Foo’;
document.write(daysOfNote[new Date().toDateString()] ? ” + daysOfNote[new Date().toDateString()] : ‘Quote Database Not Yet Completed’);
it displays the days note depending on what day it is, now i would like to do a similar thing in php but only take into consideration the date eg 31 not month i have tried to methods both failed π‘
[code=php]
<?php
$date_array = getdate(); // no argument passed so today’s date will be used
foreach ( $date_array as $key => $val ) {
print “$key = $val<br>”;
}
?>
<?php
$day = array(“0” “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “10”, “11”, “12”, “13”, “14”, “15”, “16”, “17”, “18”, “19”, “20”, “21”, “22”, “23”, “24”, “25”, “26”, “27”, “28”, “29”, “30”, “31” );
print $day[$date_array[‘mday’]];
?>
[code=php]
<?php
$day = array(“0” “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “10”, “11”, “12”, “13”, “14”, “15”, “16”, “17”, “18”, “19”, “20”, “21”, “22”, “23”, “24”, “25”, “26”, “27”, “28”, “29”, “30”, “31” );
print $day[‘mday’];
?>
could someone please help me out
Thanks96