I want to display images from the website "https://picsum.photos/v2/list", however when I try to echo out the url, I get a 404 error. What am I missing from my code? This is what I have so far:
<?php
$url = "https://picsum.photos/v2/list";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$picture = json_decode(curl_exec($curl), true);
curl_close($curl);
?>
<?php
if(!empty($picture)){
echo 'Picture:';
foreach($picture as $post){
echo '<img src= "'. $post["url"] .'" />';
}
}
?>
text/htmltype of. How could he show the image then?urltodownload_url.