3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump( preg_match('/^(\d{1,2})\D(\d{1,2})\D(\d{4})$/', '23/04/2015', $matches) ); var_dump( $matches ); var_dump( sprintf("%04d-%02d-%02d", $matches[3], $matches[2], $matches[1]) );
based on CXQYL
Output for 4.3.0 - 7.2.0
int(1) array(4) { [0]=> string(10) "23/04/2015" [1]=> string(2) "23" [2]=> string(2) "04" [3]=> string(4) "2015" } string(10) "2015-04-23"