H
H
hdtor2018-03-14 20:07:39
Regular Expressions
hdtor, 2018-03-14 20:07:39

How to rip out IMG?

There is a piece of code:

$text = '<img src="<?=SITE_TEMPLATE_PATH;?>/img/ekspert_sect3-1.png">';

preg_match('/<img[^>]+>/', $text, $images); 

var_dump($images);

As a result, the code should receive the entire IMG tag, but only the trimmed IMG is obtained. How to make it so that the IMG is completely torn out?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Tereshchuk, 2018-03-14
@hdtor

'/<img(.*)>/iSu'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question