I have a string like this:
$str = "<div>
<b>
<label>Company-Name : Anything</label>
</b>
</div>
<div>
<b>
<label>First-Name : Alex</label>
</b>
</div>
<div>
<b>
<label>Cell-Phone : 035123913</label>
</b>
</div>";
Now I want this array:
$arr = array ("Company-Name"=>"Anything",
"First-Name"=>"Alex",
"Cell-Phone"=>"035123913");
How can I do that?
As far as I realized by searching, there is a function which removes all html tags:
strip_tags($str);
I think the above function is a clue. Also there is two characters which are constant: \n and :. I think we can use them to explode the result. (however I'm not sure, maybe I'm wrong)