There is a code:
<?php $a = '<div style="text-align:center;"><!--image_begin:https://dl.site.com/20/NTQ3Nw==/Fists.jpg|--></div>'; preg_match('/image\_begin\:(.+)\|\-\-\>/', $a, $b); print_r($b); Array ( [0] => image_begin:https://dl.site.com/20/NTQ3Nw==/Fists.jpg|--> [1] => https://dl.site.com/20/NTQ3Nw==/Fists.jpg ) How to get rid of [0] => image_begin:https://dl.site.com/20/NTQ3Nw==/Fists.jpg|--> ?
That is, as a result, only the URL of the search image is displayed as the only element of the array. I am a regular no expert on this appeal to you.
unset($b[0]). In general, the first element corresponding to the entire template is the normal behavior ofpreg_match. - Yegor Banin(?<=image_begin\:).+(?=\|-->). - Yegor Banin