Jump to content

Help Parsing a string.


Perad

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.