Just ran into an issue where I needed to know the last day of the month in PHP. Sure enough, there’s a way. date(’Y-m-d’,strtotime(’+1 month’,strtotime(date(’m').’/01/’.date(’Y').’ 00:00:00′))-1); That line will output something like 2011-03-31. If you need just the Unix timestamp, you can just remove the date function. It’ll output something like 1301633999, which is 2011-03-01 [...]
Symfony doesn’t have a documented way of created dynamic database connections. If I had to take a guess, it’s because database connections in Symfony don’t interact directly with the abstraction layer–the part that actually talks to the database–but instead interacts with the ORM layer–the part that turns results from the database into the objects you’re [...]
Today I started working on a small-scale business rule management system in PHP for a project. Part of it was creating an autoloader script which you place into the directory of files and include it into your PHP script. It’ll iterate through all the files in the directory and subdirectories to include all the PHP [...]