I have a problem with the function preg_split
in php
My regexp is
#^(-?[0-9]+)(([+x])(-?[0-9]+))*$#
I want for example transform :
-5+69x45
in an array like this
{
[0] = -5
[1] = +
[2] = 69
[3] = x
[4] = 45
}
My regexp work and math with preg_match
But with preg split I don't have my array
I have a empty array without flag or
{
[0] = -5
[1] = x
[2] = 45
}
With the flag PREG_SPLIT_DELIM_CAPTURE
Where is my error?