php - how to replace date format in a dynamic string variable? -


my variable dynamic string variable in string have date value , looks like

$var = 'bd','100','10-05-2013','20-05-2013','alise'; 

but want change date format like

$var = 'bd','100','2013-05-10','2013-05-20','alise'; 

my variable dynamic date position , number of dates not fixed.

thanks

i recommend using strtotime (see http://php.net/manual/en/function.strtotime.php). can iterate on var (explode if need) , check whether false returned. else meaningful date/date time , timestamp.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -