Hi, I want to do a special tool for my customers, and this tool in the begginer have to get all url's of first results of google image:
1- If I search for "sun", the url of google image is "http://images.google.pt/images?gbv=2&hl=pt-PT&q=sun
2- This result show 18 images, and each image have url like this: "http://images.google.pt/imgres?imgurl=http://arte.vital.zip.net/images/sun.gif&imgrefurl=http://ec-mello.zip.net/&usg=__TXRPHyn0eNAl9frBatKr6xkWxYI=&h=459&w=652&sz=159&hl=pt-PT&start=1&tbnid=ef6f14gPW3U0UM:&tbnh=97&tbnw=138&prev=/images%3Fq%3Dsun%26gbv%3D2%26hl%3Dpt-PT
3- I just want this part of each url (the original localization of each image):
I try with the code you see in 'code', but I need the regular expression.
Somebody have a great solution or the regular expression?
$texto = "sun";
$url = "http://images.google.pt/images?gbv=2&hl=pt-PT&q=$texto";
$file = @file_get_contents($url);
preg_match_all("REGULAR EXPRESSION", $file, $matches);