Passing variables from PHP to C++
Posted
by
Alex
on Programmers
See other posts from Programmers
or by Alex
Published on 2012-10-10T08:47:47Z
Indexed on
2012/10/10
9:51 UTC
Read the original article
Hit count: 221
I’m new to this so I’m sorry if my question is trivial. I have the following situation: I need to call a program from PHP and pass some vars and/or sets of key-value pairs to it. Now, my question is: how do I pass these vars, through arguments to the called function (e.g. exec("/path/to/program flag1 flag2 [key1=A,key2=B]");
)? Or is there a better method to achieve this? Somebody suggested me to write them into a txt file and pass the path to it to as an argument instead (e.g. exec("/path/to/program path_to_txt_file);
), but I’m not to excited about this method.
© Programmers or respective owner