I have string like bellow
Ref ID =={1234} [201] (text message)
I want to create an array like bellow
array(
0 => 1234,
1 => 201,
2 => "text message"
)
Right now i am doing with Exploding the string method, but its took 8 lines of coding with multiple explode like bellow.
$data = array();
$str = 'Ref ID =={1234} [201] (text message)';
$bsArr1 = explode('}', $str);
$refIdArr = explode('{', $bsArr1);
$data[0] = $refIdArr[1];
$bsArr2 = explode(']', $bsArr[1]);
$codeArr = explode('[', $bsArr2[0]);
....
....
....
Is there anyway to achieve this with preg_match?