preg_match returns only the first result.
lets say I have the string abcabcabc and I wanna find ALL indexes of ABC. (ofcourse mine is a bit more complex…) – how can I do it ?
Thank you!
preg_match returns only the first result. lets say I have the string abcabcabc and
Share
preg_match_all
You simply have to pass in a variable as the third argument that will be loaded up with all your matches.
Example
output: