首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > PHP > 图书馆有一个网址,把它描述、标题和图片。

图书馆有一个网址,把它描述、标题和图片。

资 源 简 介

This library was built and tested with Kohana PHP v2.4.3. The library gets a URL using the PHP function Curl(), then uses regular expressions to get the title and all the images of sizes greater than 60m2 from the HTML page.Then, the images are then resized to thumbnail and saved. The library also uses the PHP function get_meta_tag() to get the description of the page. The URL is also return. To use the library you need to place the Fetch.php file into the library folder under the kohana application folder. Then instantiate the library in your controller. For example the codes below will display the title, descriptions and links: Sample Usage: $fetch= new Fetch($url); echo $fetch->title(); echo $fetch->description(); echo $fetch->link(); You can use $fetch->image(); for the images. Since the images are return as an array you can loop through using the foreach loop to get the saved thumbnails from the root directory. The library is still undergoing some testing, I
VIP VIP
0.231110s