S
S
Shillkas112019-03-19 21:10:59
PHP
Shillkas11, 2019-03-19 21:10:59

Processing strings with html code in PHP?

Hello. It is necessary to process rows from the database, they contain html code, and the essence is that you need to look in the text for example divs with the example class, take their contents, process them and put them back. What is the most convenient way to implement this in PHP, only fiddling with regular expressions in html code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2019-03-19
@Shillkas11

No, it is difficult to do this with regular expressions, and in some cases it is impossible at all.
Choose one of the parsers . DiDom, dom-crawler or zend-dom for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question