I feel there is a way to do this with a shortcut:
$date_array = explode("-", $date); $day = $date_array[2];
Sort of:
$day = explode("-", $date)[2];
Basically get an answer and set it to something?
I don’t remember, but there aren’t a bunch of weird "=" things like concatenation .= . Are there any other shortcuts? It seems that I could not find an article on Google with all the shortcuts.
I don’t like doing $date_array when all I really want is $day makes me feel like my code is not efficient.
EDIT: Changed the name to be more universal, can't come up with anything good.
user1631995
source share