I have this string:
<img src="http://localhost:8080/omeka3/files/square_thumbnails/a1641b89b518599b049efa6017f92040.jpg" alt="altText" title="Title">
I want to extract the value of the src attribute, to create a meta element like this:
<meta itemprop='thumbnailUrl' content='http://localhost:8080/omeka3/files/square_thumbnails/a1641b89b518599b049efa6017f92040.jpg' />
I tried the explode function:
$img_tag = item_image('square_thumbnail');
$thumbnailUrl = explode("=",$img_tag);
echo "<meta itemprop='thumbnailUrl' content='".$thumbnailUrl[1]."'/>";
But the result is:
<meta itemprop='thumbnailUrl' content='"http://localhost:8080/omeka3/files/square_thumbnails/a1641b89b518599b049efa6017f92040.jpg" alt'/>
There's any way to indicate the limit of the string at .jpg, with explode() or another function?
Thanks!