Quantcast
Channel: DaniWeb Solved Topics
Viewing all articles
Browse latest Browse all 582

How to convert a string to json in the ascending order of date ?

$
0
0

Dear Friends,

I have a string with structure

$selectedTime = "2017-02-10 07:00,2017-02-10 08:00,2017-02-11 09:00";

I need to convert it as

  {"2017-02-10":[{"start":"07:00"},{"start":"08:00"}],"2017-02-11":[{"start":"09:00"}]}

any idea ? please advise asap

Thanks
Anes


Viewing all articles
Browse latest Browse all 582

Latest Images

Trending Articles



Latest Images