June, 2012Archive for

How to get a list of month between two dates using PHP

This demo will show you how to get a list of month between 2 dates. First, let's find out how to get the next month : Now, we can get a month list between 2 dates. The result will return :

MySQL group by day, month or year

Using the DATE_FORMAT operator, you can easily group the timestamp, date or datetime column using any format you want. For example, I needed to group rows that were added on the same day. Here is my query: This query will give you result like this : Group by month: Group by year:

Import CSV File into PHP Array

A Comma-separated values (CSV) file stores tabular data (numbers and text) in plain-text form. Often it is one record per line seperated by a comma or any other delimeter. The comma , is often used in USA/UK CSV files where Germany often uses a ; instead This is an example of a simple CSV file that has 4 fields and 2 records (1 per line) In PHP it is often useful to be able to read a CSV file and access it’s data. That is where the fgetcsv() funtction comes in handy, it will re...

Capture Image Screenshots with PHP

Since PHP 5.2.2 it is now possible to capture a website or any window’s screenshot to an image with PHP as long as it is running on a Window’s machine. Most web-servers are running Linux but this could be useful for a tool on your home Dev server. Capture Whole Screen Capture an Application’s Window