TO DISPLAY THE CURRENT DATE <?php $current_date = date("Y-m-d"); echo $current_date; ?> OUTPUT If you want to show current date with Hours, Minutes and Seconds. Then try the following code. <?php $current_date = date("Y-m-d H:i:s"); echo $current_date; ?> OUTPUT If ...
phpsupport | phpsupportdesk Latest Articles
Echo & Print
pHpSupportTwo basic ways to get output in PHP are Echo and Print. Echo and Print are most likely same. Both are used to output data to the screen. But Echo is faster than Print. To print some value in PHP ...
PHP Introduction
pHpSupportPHP Introduction :- Earlier PHP comes out to be a small open source project. More and more people found it useful. The first version of PHP was unleashed in 1994 by Rasmuslerdorf. PHP in itself is recursive acronym for “PHP: ...
How to use Ajax using jQuery in PHP?
pHpSupportHow to use Ajax using jQuery in PHP? Firstly, you have to include the <script src=”https://code.jquery.com/jquery-1.12.0.min.js”></script> before </head> Or use the latest jQuery version as required. Then, use the main content of the page as below code: <div id=”content”> <ul> ...
How to get the list of file names in a folder in PHP?
pHpSupportIn PHP5, PHP7 it is easier to find the name of files. We are having the function using which we can find the names of the files under a specific folder. You can use the: <?php $dir = ‘C:/xampp/htdocs/phpSupport/questions/doctopdf/’; ...
How to produce forget password recovery method with PHP?
pHpSupportHere we need to create two pages connect.php forgotpassword.php file 1:-connect.php <?php $connection = mysql_connect(‘localhost’, ‘root’, ”); if (!$connection){ die(“Database Connection Failed” . mysql_error()); } $select_db = mysql_select_db(‘test’); if (!$select_db){ die(“Database Selection Failed” . mysql_error()); } file 2:- forgotpassword.php <?php ...
Send attachment in PHP mail function
pHpSupportIn this post you will learn how to send doc attachment, pdf attachment any file attached in your php email. You can send a file through php mail function using HTML form in PHP. Firstly you have to create simple ...
How can we start the session in core php?
pHpSupportIn this post you will learn how to start the session in core php. Please check the code given below. This will help. PHP Code To start a session, you need to add the following code at the top of ...
To create connection with MySQLi in PHP
pHpSupportIn this post you will learn how to create connection with MySQLi in PHP. Please check the code given below. This will help. PHP Code $host = “localhost”; // Enter your host name $sqlusername = “username”; // MySQL username $sqlpassword ...
Comparison Of Two Dates For Conditions – PHP
pHpSupportIn this post you will learn how to compare two dates in PHP. The best method of this is to change the dates to strtotime. Please check the code given below. This will help. Date Format is YYYY-MM-DD PHP Code ...
PHP string concatenation
pHpSupportJust use . for concatenating. And you missed out the $personCount increment! while ($personCount < 10) { $result .= $personCount . ‘ people’; $personCount++; } echo $result;
How to convert object into Array – PHP
pHpSupportGenerally we sometimes we got stuck while doing coding. I used this function to easily converting object into array if needed. Hope it will help to someone else. function object_to_array($object){ if(is_array($object) || is_object($object)){ $array = array(); foreach($object as $key => ...