PHP format date in string
To convert the date-time format PHP provides strtotime() and date() function. We change the date format from one format to another.
Change YYYY-MM-DD to DD-MM-YYYY
<? php.
$currDate = "2020-04-18";
$changeDate = date("d-m-Y", strtotime($currDate));
echo "Changed date format is: ". $changeDate. " (MM-DD-YYYY)";
?>$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
Also in PHP:
- create new laravel project 8
- ci db query error
- create new project in laravel 7
- blob image to base64 php
- blade comment
- date method php
- array key exi
- array empty check in php
- SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; m ax key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`e mail`))
- array_unique() on value php
- base64 img com php
- PHP Fatal error: Uncaught Error: Class 'IntlDateFormatter' not found in /var/www/html/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
- file_get_contents(): SSL: The operation completed successfully but file_get_contents(http://www.b2bsoftwareking.com): failed to open stream: No connection could be made because the target machine actively refused it. in
- console log data php
- array reverse in php example
- artisan make auth
- $this->db->where codeigniter result
- exception php
- base64 dencode GET variables in PHP
- PHP string mask day-year
- find key in array php
- clear views cache laravel
- base64 to image
- display the type in php