I have the following string:
!fun(10,20)
I am trying to split it into the following component parts:
!, fun, 10, 20
The ! is always the first character. The fun is always the next 3 chars after the !, the 10 will always follow an open bracket (, the 20 will be always follow the first comma , before the close bracket.
I’ve tried using PHP functions but have been banging my head against a wall. I am presuming I can do this using a regular expression or similar.
You can use
preg_matchThen
$matcheswill contain:I’m no expert with regex, feel free to comment if it can be reduced.