Suppose there is a line 12345:45 . I wrote a piece of code that leaves only what comes after the colon. And now how to do everything so that everything goes up to the colon?

 $lat = explode(':', $coordinates); $lat = end($lat); 
  • one
    end - pointer to the last element, reset - to the first. Not too harmonious, but it's PeHaPe ... - user207618
  • Yes, just $lat[0] ... - PinkTux
  • Do you need to use both parts (before and after the colon) or just some one? - Dmitriy Simushev

1 answer 1

 list($lat1, $lat2) = explode(':', $coordinates);