milly
-
Posts
4 -
Joined
-
Last visited
Never
Posts posted by milly
-
-
i have tried...
[code]
oreach($uniqueTown as $townImage) {
$url = "http://images.google.co.uk/images?q=$townImage";
$googleImages = implode(" ", file($url));
foreach($googleImage as $google) {
preg_match_all("/(((a-zA-Z0-9-]*\.){1,})[a-zA-Z0-9\.\/_%&-~{1,}\.(jpg|JPG|gif|GIF))/", $google, $imageArray);
foreach($imageArray as $image) {
echo $image;
}
}
}
[/code]
but this doesn't work either as returns nothing... can anyone see where i'm going wrong, please. -
any suggestions anyone?
-
Hi all,
I am basically trying to get the image url's of of google image search page, i have got everything to work for one instance of the search but when i try to loop it to do the search for many image searches the arrays will not echo the results.
[code]
<?php
$town = "scarborough";
$url = "http://images.google.co.uk/images?q=$town";
$googleImages = implode(" ", file($url));
preg_match_all("/(((a-zA-Z0-9-]*\.){1,})[a-zA-Z0-9\.\/_%&-~{1,}\.(jpg|JPG|gif|GIF))/", $googleImages, $imageArray);
print_r($imageArray);
?>
[/code]
but if i try to loop it to produce image urls for different towns it just prints 'array' for each town.
[code]
<?php
foreach($uniqueTown as $townImage) {
$url = "http://images.google.co.uk/images?q=$townImage";
$googleImages = implode(" ", file($url));
preg_match_all("/(((a-zA-Z0-9-]*\.){1,})[a-zA-Z0-9\.\/_%&-~{1,}\.(jpg|JPG|gif|GIF))/", $googleImages, $imageArray);
print_r($imageArray);
}
?>
[/code]
i know this is probably something really stupid but its got me stuck, could anyone help me out?
Cheers, little milly.
Help with printing arrays of image url's
in PHP Coding Help
Posted