convert dd/mm/yyyy to yyyy-mm-dd in mysql php
$var = '20/04/2012';
$date = str_replace('/', '-', $var);
echo date('Y-m-d', strtotime($date));
$date = DateTime::createFromFormat('d/m/Y', "24/04/2012");
echo $date->format('Y-m-d');
Also in PHP:
- Allowed memory size of 33554432 bytes exhausted (tried to allocate 5287496 bytes) on laravel
- dateformt php
- Str in laravel
- add floater to open a modal in wordpress
- adjacent post sort order by post title
- create laravel project without template
- elementor hide button if input empty
- Woocommerce custom Flat Rate charges (by ID) Function
- array key xists
- apache php e_warnings e_notice off
- add validation for webp image in laravel
- 7 reasons why Lee is an idiot
- composer create-project --prefer-dist laravel/laravel blog
- debug php with print
- access config variable in codeigniter controller
- create database backup programmatically php
- Best code editors for php
- execution time exentd php
- check an string incudes a string php
- artisan create new project
- create table modal and seeder at once in laravel
- daye in php
- How can I install php7.4 on Ubuntu 18.04?
- debug native php