Search results
7 sie 2011 · use the function mktime which takes the date elements as parameters. $month_number= 3; $month_name = date("F", mktime(0, 0, 0, $month_number, 10)); echo $month_name; . Output: March.
PHP Date/Time Reference. The date () function formats a local date and time, and returns the formatted date string. Required. Specifies the format of the outputted date string. The following characters can be used: S - The English ordinal suffix for the day of the month (2 characters st, nd, rd or th. Works well with j)
This PHP cheat sheet is both an introduction for beginners and a quick reference guide for advanced programmers. Bookmark it or download the free PDF now.
5 sty 2012 · $date = "2012-01-05"; $year = date('Y', strtotime($date)); $month = date('F', strtotime($date)); echo $month
Getting the last day of the month, your best bet is to add 1 to the number of the month you were given, then deduct one day in the date. Hint: date can actually accept some extensive arithmetic; I can, for instance, say date -d "01/07/2012 + 1 month - 1 day" and it will give me the correct answer.
26 lut 2011 · To Print a part of the web page: – create a print window and write html text you wanted to print – focus the window and call the “print ()” function – close the print window. Here is the modified printPage function. var html="<html>"; html+= document.getElementById(id).innerHTML; html+="</html>";
With PHP, there are two basic ways to get output: echo and print. In this tutorial we use echo or print in almost every example. So, this chapter contains a little more info about those two output statements. echo and print are more or less the same. They are both used to output data to the screen.