Travels

Travels

This answer is going to be far less efficient than using explode(). I would not put this in any professional script. If it is possible for your incoming string to be empty, then write a simple falsey check before exploding instead of using a preg_ call containing a literal character. If a string might have a trailing delimiter and you don't want that, then just rtrim() the delimiter off -- again, no reason to lean on regex (and I love regex).

Comments (4)

  • Abullah Mahtab

    10 Jan 2023

    This answer is going to be far less efficient than using explode(). I would not put this in any professional script.

  • Alchemy Admin
    11 Jan 2023

    This is my first reply

  • Azharul Islam

    10 Jan 2023

    asASAsa

  • Azharul Islam

    10 Jan 2023

    asdasdasdas

  • Azharul Islam

    11 Jan 2023

    aasdasdsadas

  • Alchemy Admin
    11 Jan 2023

    asdada

  • Alchemy Admin
    11 Jan 2023

    asdada

Leave a Reply

Allow Cookies

By using our website you are consenting to our use of cookies in accordance with our cookie policy.