<tfoot id='8AKE4'></tfoot>
      <bdo id='8AKE4'></bdo><ul id='8AKE4'></ul>
      1. <i id='8AKE4'><tr id='8AKE4'><dt id='8AKE4'><q id='8AKE4'><span id='8AKE4'><b id='8AKE4'><form id='8AKE4'><ins id='8AKE4'></ins><ul id='8AKE4'></ul><sub id='8AKE4'></sub></form><legend id='8AKE4'></legend><bdo id='8AKE4'><pre id='8AKE4'><center id='8AKE4'></center></pre></bdo></b><th id='8AKE4'></th></span></q></dt></tr></i><div id='8AKE4'><tfoot id='8AKE4'></tfoot><dl id='8AKE4'><fieldset id='8AKE4'></fieldset></dl></div>

        <legend id='8AKE4'><style id='8AKE4'><dir id='8AKE4'><q id='8AKE4'></q></dir></style></legend>

        <small id='8AKE4'></small><noframes id='8AKE4'>

        PHP标准输入?

        时间:2023-10-02

        <tfoot id='8EOIF'></tfoot>
              • <bdo id='8EOIF'></bdo><ul id='8EOIF'></ul>

                <small id='8EOIF'></small><noframes id='8EOIF'>

                <legend id='8EOIF'><style id='8EOIF'><dir id='8EOIF'><q id='8EOIF'></q></dir></style></legend>
                  <tbody id='8EOIF'></tbody>
                <i id='8EOIF'><tr id='8EOIF'><dt id='8EOIF'><q id='8EOIF'><span id='8EOIF'><b id='8EOIF'><form id='8EOIF'><ins id='8EOIF'></ins><ul id='8EOIF'></ul><sub id='8EOIF'></sub></form><legend id='8EOIF'></legend><bdo id='8EOIF'><pre id='8EOIF'><center id='8EOIF'></center></pre></bdo></b><th id='8EOIF'></th></span></q></dt></tr></i><div id='8EOIF'><tfoot id='8EOIF'></tfoot><dl id='8EOIF'><fieldset id='8EOIF'></fieldset></dl></div>

                  本文介绍了PHP标准输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我知道 PHP 通常用于 Web 开发,其中 没有标准输入,但 PHP 声称可用作通用脚本语言,如果您遵循它是基于 Web 的时髦公约.我知道 PHP 使用 printecho 打印到 stdout(或任何你想调用的东西),这很简单,但我我想知道 PHP 脚本如何从 stdin 获取输入(特别是使用 fgetc(),但任何输入函数都可以),或者这是否可能?

                  I know PHP is usually used for web development, where there is no standard input, but PHP claims to be usable as a general-purpose scripting language, if you do follow it's funky web-based conventions. I know that PHP prints to stdout (or whatever you want to call it) with print and echo, which is simple enough, but I'm wondering how a PHP script might get input from stdin (specifically with fgetc(), but any input function is good), or is this even possible?

                  推荐答案

                  可以通过创建 php://stdin 的文件句柄来读取 stdin 和然后使用 fgets() 从中读取一行(或者,正如您已经说过的,fgetc() 用于单个字符):

                  It is possible to read the stdin by creating a file handle to php://stdin and then read from it with fgets() for a line for example (or, as you already stated, fgetc() for a single character):

                  <?php
                  $f = fopen( 'php://stdin', 'r' );
                  
                  while( $line = fgets( $f ) ) {
                    echo $line;
                  }
                  
                  fclose( $f );
                  ?>
                  

                  这篇关于PHP标准输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何通过 Slim php 和 Paris 将主干模型数据发布到数 下一篇:file_put_contents - 无法打开流:权限被拒绝

                  相关文章

                  最新文章

                1. <small id='zxyMS'></small><noframes id='zxyMS'>

                2. <tfoot id='zxyMS'></tfoot>

                    <i id='zxyMS'><tr id='zxyMS'><dt id='zxyMS'><q id='zxyMS'><span id='zxyMS'><b id='zxyMS'><form id='zxyMS'><ins id='zxyMS'></ins><ul id='zxyMS'></ul><sub id='zxyMS'></sub></form><legend id='zxyMS'></legend><bdo id='zxyMS'><pre id='zxyMS'><center id='zxyMS'></center></pre></bdo></b><th id='zxyMS'></th></span></q></dt></tr></i><div id='zxyMS'><tfoot id='zxyMS'></tfoot><dl id='zxyMS'><fieldset id='zxyMS'></fieldset></dl></div>
                      <legend id='zxyMS'><style id='zxyMS'><dir id='zxyMS'><q id='zxyMS'></q></dir></style></legend>
                        <bdo id='zxyMS'></bdo><ul id='zxyMS'></ul>