Perad Posted December 11, 2009 Share Posted December 11, 2009 Hi, I have a string which looks like this. <p style=\"text-align: left;\"><b><i><u>Left</u></i></b><br></p> <p style=\"text-align: center;\"><b><i><u>Middle</u></i></b></p> <p style=\"text-align: right;\"><b><i><u>Right</u></i></b></p> What I need to do is create a associative array from the above string. Something like this. array ('p' => array ('style' => array ('text-align' => 'center', 'property2' => 'value2')), 'content' => '<b><i><u>Left</u></i></b><br>'); I then put it back together again in a different format. Any ideas how I would go about doing this? The only tag that will appear is a <p> tag. Link to comment https://forums.phpfreaks.com/topic/184753-help-parsing-a-string/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.