Format date coming from variable with php [closed]

-1

I have the variable below and I want to format it to the Brazilian standard (01/20/2015) using PHP.

$data = Sun Jan 10 00:00:00 CST 2016
    
asked by anonymous 30.10.2015 / 21:53

1 answer

3

Convert this date to for timestamp with strtotime() and then take the desired format with date()

echo date('d/m/Y', strtotime('Sun Jan 10 00:00:00 CST 2016'));

Example - 3v4l

    
30.10.2015 / 23:54