本文介绍了CasperJS将数据传递回PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
CasperJS.在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 ]] )
接着说:
所以基本上可以执行exec('casperjs命令在这里$ array_here);
So basically you can do exec('casperjs command here, $array_here);
这篇关于CasperJS将数据传递回PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!