<?php
$data = "10/01/2016";
function beforeSaveData($data){
$novaData = $data[2] . "-" . $data[1] . "-" . $data[0];
return $novaData;
}
$novaData = beforeSaveData($data);
echo $novaData;
// your code goes here
PD9waHAKCiRkYXRhID0gIjEwLzAxLzIwMTYiOwpmdW5jdGlvbiBiZWZvcmVTYXZlRGF0YSgkZGF0YSl7CiAgICAkZGF0YSA9IGV4cGxvZGUoIi8iLCAkZGF0YSk7CiAgICAkbm92YURhdGEgPSAkZGF0YVsyXSAuICItIiAuICRkYXRhWzFdIC4gIi0iIC4gJGRhdGFbMF07CiAgICByZXR1cm4gJG5vdmFEYXRhOwkKfQokbm92YURhdGEgPSBiZWZvcmVTYXZlRGF0YSgkZGF0YSk7CmVjaG8gJG5vdmFEYXRhOwovLyB5b3VyIGNvZGUgZ29lcyBoZXJl