why not worked str_replace? what do i do?
$date = $this->convert_date->JalaliToGregorian('1390','04','20'); ->> this output with json_encode -> [2011,7,11]
$da = str_replace(",","/",$date);
echo json_encode ($da) ->> output Array ["2011","7","11"]
why not worked str_replace? what do i do?
$date = $this->convert_date->JalaliToGregorian('1390','04','20'); ->> this output with json_encode -> [2011,7,11]
$da = str_replace(",","/",$date);
echo json_encode ($da) ->> output Array ["2011","7","11"]
The commas are not in the array. That's being added by json_encode. Try implode("/", $date); That will combine the three array elements using / as glue.