0

hello I want to remove this T00:00:00 from the Date. Start Date: 2022-03-25T00:00:00

        foreach ($data as $key => $value) {
        $startDate=   $value['startDate']
        echo "<li><h5>Start Date: $startDate</h5></li>"; 
ADyson
  • 57,178
  • 14
  • 51
  • 63
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackoverflow.com/rooms/243027/discussion-on-question-by-trevor-scholtz-php-get-info-from-api-t00000-as-date). – Samuel Liew Mar 17 '22 at 14:06

1 Answers1

0

You can split by character 'T' and take the first part of it.

foreach ($data as $key => $value) {
    $startDate = explode("T", $value['startDate'])[0];