将数据从C ++传递到PHP [英] Passing data from C++ to PHP

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

问题描述

我需要将一个值从PHP传递给C ++。我想我可以用PHP的 passthru()函数。
然后我想让C ++做一些值,并将结果返回给PHP。
这是我无法解决的问题,有谁知道如何将数据从C ++传递到PHP?

I need to pass a value from PHP to C++. I think I can do with PHP's passthru() function. Then I want C++ to do something to that value and return the result to PHP. This is the bit I can't work out, does anyone know how to pass data from C++ to PHP? I'd rather not use an intermediate file as I am thinking this will slow things down.

推荐答案

你可以使用一个中间文件,让您的c ++应用程序将其输出发送到stdout,然后使用反引号 a>,例如

You could have your c++ app send its output to stdout, then call it from PHP with backticks, e.g.

$output=`myapp $myinputparams`;

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

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