Categories
How to get the right data?
Hello. We have $time = "from 10:00 to 22:00"; Is it possible to get data with a variable like this, for example $timef = "10:00"; $timel = "22:00";
Answer the question
In order to leave comments, you need to log in
preg_match_all('~\d\d:\d\d~', $time, $match); list($timef, $timel) = $match[0];
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question