I would like to be able to parse the following data using PHP:
$string = "<![CDATA[<div><b>Color:</b> Blue</div>
<div><b>Number:</b> 5</div>
<div><b>Month:</b> January</div>]]>";
Into an array such as:
Array
(
[Color] = Blue
[Number] = 5
[Month] = January
)
I attempted to use preg_match to extract the data between , however, it would not produce any matches.
preg_match_all("/\[CDATA\[(.*?)\]]/", $string, $result);
I can't get past this point. Any help would be appreciated.
(.*?)has a?. and why haven't you escaped]in\]]?