将输入传递给 C 程序并使用 php 获取输出
我正在开发一个项目,我编写了两个 C 程序,将日期和时间转换为分钟,然后再转换回来。我想要做的是将 php 变量传递给 C 程序,然后让 C 程序将结果返回给 php 中的变量。
我意识到您可以使用 popen 或 exec 命令,但我不确定如何使用这些命令。
我将如何构建 php 代码? 我必须在 C 程序中使用哪些输入和输出命令?如果你们能给我举几个例子那就太好了。我从例子中学得更好。
提前致谢。
I am working on a project and I wrote two C programs that convert date and time into minutes and then back. What I want to do is pass a php variable into a C program and then have the C program return the result to a variable in php.
I realize that you can use popen or exec commands but I am unsure how to use these commands.
How would I structure the php code?
What input and output commands would I have to use in the C program? If you guys could give me a few examples that would be great. I learn better from examples.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)