In this example,I will learn you how to get last day of current month from date in codeigniter.you can easy and simply get last day of current month from date in codeigniter.
Within $format, we will pass “Y-m-t” and within $timestamp the date taken above. In terms of date “Y” gives a full numeric representation of a year in 4 digits, “m” provides numeric representation of a month and “t” gives the number of days in the given month.
public function index()
$date = date('Y-m-t');
It will help you...