vendredi 12 janvier 2018

in PHP, how to search for pattern and insert in middle of string

Hours string like:

Monday 1100 AM – 330 PM

in PHP, I'd like to insert a colon in middle of the hours which can be 3-4 digits long. And the minutes may NOT always be 00.

Result: Monday 11:00 AM – 3:30 PM

How can I do that?

thanks

Aucun commentaire:

Enregistrer un commentaire