Okay this is probably all over the internet but I can't find a solution and been searching and trying different ways.
So the main way i've tried so far is as following:
string:
<div data-image-id="344231" style="height: 399.333px; background-image: url("/website/view_image/344231/medium"); background-size: contain;"></div>
code:
preg_match_all('/(style)=("[^"]*")/i', $value, $match);
preg_match('/background-image: url("(.*?)");/', $match[2][0], $match);
print_r($match);
I'm guessing I can't use:
background-image: url("
and ");
instead the preg_match
Could someone give me some guidence on how I can achieve getting:
"/website/view_image/344231/medium"