I'm using PHP to scrape a few websites. The image information is contained within a script.
<body>
<div>something</div>
<div>Something else</div>
<script type="text/javascript" language="javascript">
var imgs = ['<img alt="image1" class="happy-image" src="http://example.com/image1.jpg" title = "Image 1">, <img alt="image2" class="happy-image" src="http://example.com/image2.jpg" title = "Image 2">];
</script>
</body>
I would like to extract from the this string using PHP the information associated with this image and wouldn't even know where to begin to write the regex to make this happen.