阅读PHP中的外部链接 [英] Read in external links in PHP

查看:126
本文介绍了阅读PHP中的外部链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何在Ruby中执行此操作,但是我想在PHP中执行此操作.抓取页面并能够解析其中的内容.

I know how to do this in Ruby, but I want to do this in PHP. Grab a page and be able to parse stuff out of it.

推荐答案

看看 cURL .了解cURL及其使用方法将在许多方面有所帮助,因为它并不特定于PHP.但是,如果您想要特定的内容,则可以使用 file_get_contents ,这是PHP中获取数据的推荐方式将文件内容转换为字符串.

Take a look at cURL. Knowing about cURL and how to use it will help in many ways as it's not specific to PHP. If you want something specific however, you can use file_get_contents which is the recommended way in PHP to get the contents of a file into a string.

这篇关于阅读PHP中的外部链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆