Alex Lord
asked on
Splitting string in php
$getString = "2018-09-17T17:02:10.898Z";
im using php how can i use php to split this into like below
2018-09-17
17 hour
02 min
10 seconds
? struggling for hour with preg_mach
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
$parts = array_map('trim', explode('T', $getString));
$date = $parts[0];
$hour_parts = array_map('trim', explode(':', $parts[1]));
$hour = $hour_parts[0];
$minute = $hour_parts[1];
// blah blah - you get the idea?