$string = file_get_contents(config_path('mapplic.json'));
$pattern = '~(http:|https:)\/\/[^/\s]+\/\S+\.(jpe?g|png)~i';
$m = preg_match_all($pattern,$string,$matches);
print_r($matches[0]);
foreach ($matches[0] as $i => $url){
$name = basename($url);
file_put_contents($name, file_get_contents($url));
}
Created
September 21, 2019 10:13
-
-
Save salipro4ever/56ba8ea8b03afcf9c8418bfecf870b1c to your computer and use it in GitHub Desktop.
Download all image url from string
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment