I have a sample array like this:
[
"BTCUSD",
"DASHBTC",
"DOGEUSD",
"LTCBTC",
"LTCUSD",
"SCBTC",
"STEEMBTC",
"WAVESBTC",
"SNGLSBTC",
"1STBTC",
"DASHUSD",
"BQXETH",
"PTOYETH",
"XAURETH",
"BTCUSDT"
]
How to get just one currency for every string? I can't use explode because there isn't a single/static delimiter. I can't use substr()
or strpos()
because the substrings vary.
So how to split it?
Update
This is my expected output
[
"BTC",
"DASH",
"DOGE",
"LTC",
"LTC",
"SC",
"STEEM",
"WAVES",
"SNGLS",
"1ST",
"DASH",
"BQX",
"PTOY",
"XAUR",
"BTC"
]