- str_replace: documentation ( source)
<?php
$date = '2015-09-08';
$date = str_replace('-','/',$date);
$formats_arr = array('m-d-Y','m/d/Y','Y-m-d','Y/m/d');
$dateobj = new datetime($date);
foreach ($formats_arr AS $format)
echo $format . " ==> " . $dateobj->format($format) . "\n";