I’m trying to test a php file from a C program(…)
Basically I have a filename that I want to check against php -l and store the output for further processing.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A simple solution in that case would be to redirect the output to a file. And then read the file into an array. You then can have your further processing with the array.
Something like this(in C):
Solution #2: Invoke the PHP interpreter, and pipe the output to your program.
Something like the following in the console:
In the above case, you will read the output of PHP from stdin. You can read the entire input, and directly store it to an array.