How to run wget from php so that output gets displayed in the browser window?

后端 未结 4 2229
南方客
南方客 2021-02-08 05:47

How to run wget from php so that output gets displayed in the browser window?

4条回答
  •  半阙折子戏
    2021-02-08 06:14

    The exec function can be used to run wget. I've never used wget for more then simple file downloads but you would use whatever arguments you give to wget to make it output the file contents. The second parameter/argument of exec will be an array, and this array will be filled line by line with the output of wget.

    So you would have something like:

    ', $array);
    
    ?> 
    

    The manual page for exec probably explains this better: http://php.net/manual/en/function.exec.php

提交回复
热议问题