Skip to content

Instantly share code, notes, and snippets.

@axxe16
Created October 10, 2017 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axxe16/40e73a061ff23b8dda275848dccb0361 to your computer and use it in GitHub Desktop.
Save axxe16/40e73a061ff23b8dda275848dccb0361 to your computer and use it in GitHub Desktop.
[conversione data] da usare se si parte da una data con questo format g/m/a e si vole ottenere il formato mysql #date #php #convert #toSQLformat
<?php
//perchè funzioni strtotime è necessario sostituire / con -
$data = strtotime(str_replace('/', '-' ,$_POST['data_nascita_cliente']);
//ottengo il formato richiesto
$data_nascita_cliente = date('Y-m-d', $data));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment