I am trying to get some data out from a database stored as text usnig php.
The text could be plain text /or html text.
I want to fetch the following fields from the text retrieved from database : City, state, country.
Here is the example the text could look like
country :- US
state :- Washington
city :- Bellingham
or
<table>
<tr><td>country </td><td>US</td></tr>
<tr><td>state</td><td>Washington</td></tr>
<tr><td>city</td><td>Bingen</td></tr>
</table>
or same in div tag
I have already done for plain text.
which I found to be very easy as i found the linebreak (the end of line) and trimmed rest of the text except what was required
But in case of HTML I am facing the problem, how to deal with html text. As there is no line break . Not sure whats the best way to do this if I use strip_tags it returns all text in same line i.e. country us state washington
Can’t you just do some text processing instead of HTML parsing
This will give you the same as the text-input.