English 中文(简体)
把图像搜索结果中的第一份URL与PHP中的Agogle图像相匹配
原标题:Getting the first URL of an image search result with google image API in PHP
  • 时间:2010-06-10 20:53:04
  •  标签:
  • php
  • image

你们是否知道有一套实验室的文字(一个等级是冰层),这些文字是从山角一目图像搜索得出的第一个图像的旋律? 增 编

例。

<?php echo(geturl("searchterm")) ?>
最佳回答

你们应当能够很容易地利用。 简单超文本的DOM

<>说明: 欲了解更多信息,请见网站的例子。

  • A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way!
  • Find tags on an HTML page with selectors just like jQuery.
问题回答

我已经找到了一种解决办法,利用Sarfraz所讲的简单的超声波图像从谷歌图像中获取第一个图像。

请查看以下编码。 目前,它正在为我工作罚款。

$search_keyword=str_replace(   , + ,$search_keyword);
$newhtml =file_get_html("https://www.google.com/search?q=".$search_keyword."&tbm=isch");
$result_image_source = $newhtml->find( img , 0)->src;
echo  <img src=" .$result_image_source. "> ;




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签