0

I want to grab the output of one php file to other, I am passing arguments to php file and the return value is 1 , I want to store the value in other php.

I am running this from shell as -

php t.php [email protected]

Now I want to run this from a php file which will grab the output of this into variable in the other php?

1
  • If the output of the code 1 is printed or echoed, you can use phps output buffers to capture the output content as a variable. php.net/manual/en/book.outcontrol.php Commented Sep 17, 2016 at 21:45

1 Answer 1

1

From the second script

$out = exec("php t.php [email protected]");

Or

exec("php t.php [email protected]", $out);

Or maybe from shell

php t.php [email protected] > second.php

Hope this helps!

Sign up to request clarification or add additional context in comments.

1 Comment

Glad I could help you :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.