N
N
Name2021-06-22 08:41:59
PHP
Name, 2021-06-22 08:41:59

How to extract a list of ul elements from the text and place it in an array?

There is a variable with the following data:

$q = '
<p>какой-то текст</p>
<ul class="ul">
<li>aaa</li>
<li>bbb</li>
<li>ccc</li>
</ul>
<p>какой-то текст</p>
<h2>aaa</h2>
<p>какой-то текст</p>
<h3>ccc</h3>
<p>какой-то текст</p>
<h3>bbb</h3>
<p>какой-то текст</p>
';

you need to put li elements in the array

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-06-22
@idruweb

https://snipp.ru/php/phpquery

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question