Posts Tagged "Basic PHP"

Get the First Monday of the current Month or Get Last Day of Month or Get First Day of Month

Get the First Monday of the current Month or Get Last Day of Month or Get First Day of Month Get the First Monday of the current Month <?php function getFirstMonday($month,$year) { $num = date(“w”,mktime(0,0,0,$month,1,$year)); if($num==1) return date(“Y-M-ds”,mktime(0,0,0,$month,1,$year)); elseif($num>1) return date(“Y-M-d”,mktime(0,0,0,$month,1,$year)+(86400*(8-$num))); else return date(“Y-M-d”,mktime(0,0,0,$month,1,$year)+(86400*(1-$num))); } $month = date(“m”); $year = date(“Y”); // this will output current month’s First Monday echo getFirstMonday($month,$year); ?> Get the Last Day of current Month <?php echo date(‘d/m/y’,strtotime(“last Friday”,mktime(0,0,0,date(“n”)+1,1))); // you can replace your Day instead…

Read More

PHP Features

Potential of PHP really is a superior choice for the web, you’re going to need to have a clear-cut set of reasons why you believe PHP is the superior language. This short list should help you get started: PHP is cross-platform. It can be run on Windows, Linux, BSD, Mac OS X, and Solaris, as well as a variety of other platforms. PHP is free. You can download the source code, use it, and even make changes to it without…

Read More

Simple email script in php

This chapter explains how to send email in php. We will upload advanced mailing script in php soon. Download the script : Simple email script in PHP Shashi Dhar KumarShashi Dhar Kumar Experience in Web/software development including client server and implementation using PHP, XML, MySQL and SQL Server. Experience of working on Apache, Linux projects, Javascript, Ajax, Putty, FTP, Remote Connection, XML parsing, Mod-Rewriting, Payment Gateways and shipping modules, Trouble shooting and Manual Testing. https://www.shashidharkumar.in

Read More

PHP Tutorial – Part I

Why PHP? Why you should choose PHP over other languages such as Perl or even why you should learn a scripting language at all. Learning a scripting language, or even understanding one, can open up huge new possibilities for the website. With an understanding of a scripting language you can easily edit these scripts to do what you want, or even create your own scripts. Using scripts on your website allows you to add many new ‘interactive’ features like feedback…

Read More

PHP-Interview Question

Question : What are the differences between Get and post methods in form submitting. Give the case where we can use get and we can use post methods? Answer : When to use GET or POST The HTML 2.0 specification says, in section Form Submission (and the HTML 4.0 specification repeats this with minor stylistic changes): –>If the processing of a form is idempotent (i.e. it has no lasting observable effect on the state of the world), then the form…

Read More