Quantcast
Channel: How to split a string at the first colon - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Toto for How to split a string at the first colon

As it's been said, explode is the right tool to do this job.However, if you really want a regex, here is a way to do:with preg_match:$str = "X-Storage-Url:...

View Article


Answer by msgmash.com for How to split a string at the first colon

$array = array_map('trim', explode(':', $str, 2));

View Article

How to split a string at the first colon

$str = "X-Storage-Url: https://pathofanapi";I would like to split this into an array ("X-Storage-Url", "https://pathofanapi").Could someone tell me the regex for this ? Regex has always been my...

View Article
Browsing all 3 articles
Browse latest View live