executing php script from C program and store the results in to a variable

前端 未结 3 1544
半阙折子戏
半阙折子戏 2021-01-03 09:47

I would like to execute a PHP script from a C program and store the returning content in to a C variable.

I tried like following but it doesn\'t work:

3条回答
  •  粉色の甜心
    2021-01-03 10:19

    Remember when you use execl() it will "exit on success". So, you will never see "End php function" because it will never get to that line of code.

    To overcome this problem, you may either use system or use fork() to create a child process and in your child process use execl or any other function from the exec family.

提交回复
热议问题