I recently encountered this problem on Vista running localhost with XAMPP 1.7
I had this calendar script that loads a template from a given path, but it gives me a timeout error. It was previously running smoothly on an XP machine. After further checking, I found out that the problem was something related to the PHP [...]
Category Archives: PHP Snippets
PHP file reading error in Vista
How to get the first date of the week in PHP?
To get the first date of the current week, you need subtract the numeric representation of the day of the week to the given date, in this case the current date.
The code will return the timestamp of the first date of the current date.
$timestamp = mktime(0, 0, 0, date(‘m’), date(‘d’) – date(‘w’), date(‘Y’));
From the code [...]