CasperJS passing data back to PHP

前端 未结 2 918
梦毁少年i
梦毁少年i 2020-11-28 07:51

CasperJS is being called by PHP using an exec() command. After CasperJS does its work such as retrieving parts of a webpage, how can the retrieved data be retur

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 08:15

    You can redirect output from stdout to an array.

    On this page it says you can do:

    string exec ( string $command [, array &$output [, int &$return_var ]] )
    

    It goes on to say:

    If the output argument is present, then the specified array will be filled with every line of output from the command.

    So basically you can do exec('casperjs command here, $array_here);

提交回复
热议问题