Answer the question
In order to leave comments, you need to log in
How to understand PHP regular expressions?
Help me understand how to compose regular expressions, well, I don’t understand, I manul this function.
here is an example that works as it should and allows you to get image links.
preg_match_all('/<img[^>]*'.'src=[\"|\'](.*)[\"|\']/Ui', $web_page, $images);
<img[^>]*
- how to understand it? or (.*)
- what is it? and why in the $images array there will be exactly links, and not the entire element <img ...../>
<a ...... href="/img" .......>.....</a>
or how to get the contents of the entire element<div class="content"> TEXT который надо </div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question