当前位置: 首页 > news >正文

怎么利用云盘建设网站wordpress $post->id

怎么利用云盘建设网站,wordpress $post->id,全网营销推广公司,百度搜索引擎营销案例php中文网最新课程每日17点准时技术干货分享PHP包含了以php://开头的一系列输出输出流#xff0c;如php://stdin, php://stdout等。今天查看代码时#xff0c;忽然想到一个问题#xff1a;php://output和php://stdout有什么区别#xff1f;从PHP的官方文献中找答案#xf… php中文网最新课程每日17点准时技术干货分享PHP包含了以php://开头的一系列输出输出流如php://stdin, php://stdout等。今天查看代码时忽然想到一个问题php://output和php://stdout有什么区别从PHP的官方文献中找答案对输入流php://stdin和php://input的解释分别如下(输出流的解释过于简略)php://stdinphp://stdin, php://stdout and php://stderr allow direct access to the corresponding input or output stream of the PHP process. The stream references a duplicate file descriptor, so if you open php://stdin and later close it, you close only your copy of the descriptor-the actual stream referenced by STDIN is unaffected. Note that PHP exhibited buggy behavior in this regard until PHP 5.2.1. It is recommended that you simply use the constants STDIN, STDOUT and STDERR instead of manually opening streams using these wrappers.php://stdin is read-only, whereas php://stdout and php://stderr are write-only.php://inputphp://input is a read-only stream that allows you to read raw data from the request body. In the case of POST requests, it is preferable to use php://input instead of $HTTP_RAW_POST_DATA as it does not depend on special php.ini directives. Moreover, for those cases where $HTTP_RAW_POST_DATA is not populated by default, it is a potentially less memory intensive alternative to activating always_populate_raw_post_data. php://input is not available with enctypemultipart/form-data.文档并未直接阐述两者的区别仔细对比可得出以下信息1. 均是只读流2. php://stdin是PHP进程的标准输入php://input用来读取请求正文的原始数据。通过这些信息该如何正确认识两者的本质区别顺着php://stdin进程输入的提示联想PHP进程的执行过程再结合SAPI的差异可以得到两者主要区别php://stdin是PHP进程的输入流执行生命周期内均可能有数据流入(例如CLI下的交互式输入)php://input是PHP执行时的外部输入流一般数据只能读一次(具体看SAPI的实现)。同理可得到php://stdout和php://output的区别php://stdout是PHP进程的标准输出流php://output是返回的结果数据流。下面用代码验证结论// file: test.phpfile_put_contents(php://output, message sent by output . PHP_EOL);file_put_contents(php://stdout, message sent by stdout . PHP_EOL);print(message sent by print . PHP_EOL);echo SAPI: , PHP_SAPI , PHP_EOL;命令行执行文件输出如下message sent by outputmessage sent by stdoutmessage sent by printSAPI:cli浏览器端请求输出如下message sent by outputmessage sent by printSAPI:fpm-fcgi在命令行下PHP进程的标准输出流和结果输出流均指向终端所有消息都打印出来。在浏览器端PHP进程的输出流被忽略只有结果数据流被发送到web服务器。同时print和echo调用的信息都作为执行结果发往结果输出流所以都正常显示。最后再感慨一下PHP内置函数的简洁实用一个file_put_contents函数就搞定流写入操作换Java需要stream/writer一堆代码也省去C风格的fopen/fwrite/fclose的繁琐。-END-声明本文选自「 php中文网 」搜索「 phpcnnew 」即可关注▼
http://www.pierceye.com/news/470319/

相关文章:

  • 无锡网站建设制作公司甘肃省建设工程网站
  • 广州微信网站建设哪家好公司网站排名优化手段
  • 深圳市路桥建设集团有限公司招标采购网站crntos wordpress
  • 广告网站制作报价深圳建筑设计平台网站
  • 网站ns记录南宁企业建站模板
  • 网站服务建设目前做哪些网站能致富
  • 专业网站定制公司深圳网页制作服务
  • 白云网站(建设信科网络)网页工具在哪里
  • 食品网站策划网站建设送企业邮箱吗
  • 天津自贸区建设局网站手机网站导航设计
  • 企业网站建设制作大连网站建设吗
  • 做网页兼职网站有哪些建设网站需要花费
  • 如何快速写一个网站黄页网络的推广软件下载
  • 网站建设公司注册enfold wordpress
  • 上海网站建设百度推广公司哪家好模具厂咋做网站
  • 网站背景自动切换织梦网站模板使用教程
  • 网站建设的成果怎么写找人做淘宝网站需要多少钱
  • 网站制作 企业网站建设哪家好tiktok海外运营推广
  • 南昌做网站哪个公司好玉溪市住房和城乡建设局网站
  • 男女做暖网站是什么样子的wordpress 时间轴 主题
  • 国外建设网站jsp网站开发工具
  • 网站流量怎么赚钱wordpress 08影院模板
  • win网站建设网站哪个公司做的好
  • 温州网站运营微信公众号服务号网站开发流程
  • 网站宣传的好处山西房地产网站建设
  • 网站seo工作内容大学做视频网站
  • 台州网站建设企业网站 微信开发
  • 安徽省水利厅网站 基本建设营销策划公司名称
  • 网页设计师培训学院开封做网站优化
  • 山西电力建设三公司网站影院禁止18岁以下观众观影