fopen返回资源ID#4 [英] fopen returns Resource id #4

查看:217
本文介绍了fopen返回资源ID#4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php
$handle = fopen("https://graph.facebook.com/search?q=mark&type=user&access_token=2227470867|2.mLWDqcUsekDYZ_FQQXYnHw__.3600.1279803600-100001317997096|YxS1eGhjx2rpNYLNE9wLrfb5hMc.", "r");
echo $handle;
?>

为什么回显资源ID#4 而不是页面本身?

Why does it echo Resource id #4 instead of the page itself?

推荐答案

因为fopen返回一个指向文件的resurce指针,而不是文件的内容。它只是打开它以便随后读取和/或写入,取决于您打开文件的模式。

Because fopen returns a resurce pointer to the file, not the content of the file. It simply opens it for subsequent reading and/or writing, sependent on the mode in which you opened the file.

您需要fread()来自引用的资源的数据在$ handle。

You need to fread() the data from the resource referenced in $handle.

这是你可以在php.net的手册页上自己阅读的所有基本内容

This is all basic stuff that you could have read for yourself on the manual pages of php.net

这篇关于fopen返回资源ID#4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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