When I run the following script, the image is not rendered well. What is the problem here? This is the code (it's an assignment for school and need to do that with regular expressions...):
<?php
header('Content-Type: text/html; charset=utf-8');
$url = "http://www.asaphshop.nl/epages/asaphnl.sf/nl_NL/
ObjectPath=/Shops/asaphnl/Products/80203122";
$htmlcode = file_get_contents($url);
$pattern = "/class=\"noscript\"\>(.*)\<\/div\>/isU";
preg_match_all($pattern, $htmlcode, $matches);
//print_r ($matches);
$image = ($matches[0][0]);
print_r ($image);
?>
This is the part of the link I need to copy (the data-src-l part)with the link of http://www.asaphshop.nl in front of it so i have a (complete) link of the image:
<div id="ProductImages" class="noscript">
<ul>
<li>
<a href="/WebRoot/products/8020/80203122/bilder/80203122.jpg">
<img itemprop="image" alt="Jesus Remember Me - Taize Songs (2CD)"
src="/WebRoot/AsaphNL/Shops/asaphnl/5422/8F43/62EE/
D698/EF8E/4DEB/AED5/3B0E/80203122_xs.jpg"
data-src-xs="/WebRoot/AsaphNL/Shops/asaphnl/5422/8F43/62EE/
D698/EF8E/4DEB/AED5/3B0E/80203122_xs.jpg"
data-src-s="/WebRoot/products/8020/80203122/bilder/80203122_s.jpg"
data-src-m="/WebRoot/products/8020/80203122/bilder/80203122_m.jpg"
data-src-l="/WebRoot/products/8020/80203122/bilder/80203122.jpg"
/>
</a>
</li>
</ul>
</div>
` not the value of the `data-src-l` attribute. For all others: http://stackoverflow.com/a/1732454/2265374
– ThW Oct 16 '14 at 08:34