Jump to content

milly

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Posts posted by milly

  1. 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.
  2. 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.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.