CasperJS 将数据传回 PHP [英] CasperJS passing data back to PHP

查看:44
本文介绍了CasperJS 将数据传回 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CasperJS 正在被 PHP 使用 exec() 命令调用.CasperJS 完成检索网页部分等工作后,如何将检索到的数据返回给 PHP?

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 returned back to PHP?

推荐答案

您可以将输出从 stdout 重定向到数组.

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 ]] )

接着说:

如果存在输出参数,则指定的数组将被命令的每一行输出填充.

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

所以基本上你可以做 exec('casperjs command here, $array_here);

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

这篇关于CasperJS 将数据传回 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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