创建一个PHP脚本,为其他站点拍摄图像

I am working on a script to show the sponsors of a other site. This needs to take these sponsors from that original website so when they add sponsors my script also ads these sponsors.

I got this to work locally by saving them in a folder and then use scandir to scan the names of the images and then display them using a for loop.

here is that code:

<?php
$dir = "path/to/images/";
$files = array_slice(scandir($dir), 2);
shuffle($files);

for($i=0; $i<=count($files)-1; $i++){
   echo "<img style='width:100px;' src='images/{$files[$i]}'/><br>";
}
?>

I need this to work but from a website or server and not just locally