I
I
Ilya19882019-05-20 18:09:19
PHP
Ilya1988, 2019-05-20 18:09:19

How to keep only the inside of a link in phpquery?

Hello, please tell me, I am collecting messages from the forum, but I can’t save images, even the urls on them, please tell me how to make it so that only

"текст текст текст <img src="data/attachments/61234/60548c7ad4bfa183d01402afd43e.jpg" alt="" class="bbCodeImage"> текст текст текст"

On the donor, it looks like this - that is, you need to remove the "a" tag.
текст текст текст <a href="https:/xxx.ru"><img src="data/attachments/61234/60548c7ad4bfa183d01402afd43e.jpg" alt="" class="bbCodeImage"></a>текст текст текст

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Loginov, 2019-05-20
@Ilya1988

Use contentsUnwrap

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question