Are the dates always in this exact format? If so, you could simply just explode them into an array.
$dates = explode(' - ', $jsonObject->date);
// $dates[0] = 05-01-2018
// $dates[1] = 05-03-2018
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
"date":"05/01/2018 - 05/03/2018"
how to separate this string . I want to need like this - first = 05-01-2018 and second = 05-03-2018
Are the dates always in this exact format? If so, you could simply just explode them into an array.
$dates = explode(' - ', $jsonObject->date);
// $dates[0] = 05-01-2018
// $dates[1] = 05-03-2018
Please or to participate in this conversation.