Home  >  Article  >  Backend Development  >  javascript - php怎么封装服务接口?

javascript - php怎么封装服务接口?

WBOY
WBOYOriginal
2016-06-06 20:28:151276browse

用casperJS写了一段浏览器模拟登录网页的代码,单独执行这个文件可以在控制台进行。需要在另外的php文件中调用这个js文件的执行,怎么把这个js文件封装成一个服务接口给PHP调用?

回复内容:

用casperJS写了一段浏览器模拟登录网页的代码,单独执行这个文件可以在控制台进行。需要在另外的php文件中调用这个js文件的执行,怎么把这个js文件封装成一个服务接口给PHP调用?

<code class="php">system('casperjs login.js');//
</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn