I wanted to do something like this:
list($hour, $minute) = split("/:/", $departure_time);
however it says split() is deprecated why is this? What am I doing wrong?
split belongs to the ereg class functions, which have been superseded by preg_match and preg_split.
You should be using explode() anyway, since you only have a static string, not an actual matching pattern with variable placeholders.
Use explode() instead of split().
like this:
$array = explode(':', $string);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With