I have a text:
$test = <<<START
DOTHIS themsp1
@theint = 431,
@theText = "%dumdum%",
@operator = 'ANY',
@crossCheck = 'PLUS'
START;
The filter:
$regEx = '/@(.*)=(.*)[,]*?/';
preg_match_all($regEx,$test,$vars,PREG_SET_ORDER);
print_r($vars);
The Output:
Array
(
[0] => Array
(
[0] => @theint = 431,
[1] => theint
[2] => 431,
)
[1] => Array
(
[0] => @theText = "%dumdum%",
[1] => theText
[2] => "%dumdum%",
)
[2] => Array
(
[0] => @operator = 'ANY',
[1] => operator
[2] => 'ANY',
)
[3] => Array
(
[0] => @crossCheck = 'PLUS'
[1] => crossCheck
[2] => 'PLUS'
)
)
I don't want commas OR the whitespace in the output :( .. The problem is that the commas are optional;