testers Posted July 2, 2010 Share Posted July 2, 2010 hello friends i want to process a php file and store the results in a variable. example // test.php <?PHP $value1 = "hello"; echo $value1; ?> i want to get the results of test.php and store them to $value1. ( certainly $value1 should be contain the "hello" ) thanks Quote Link to comment https://forums.phpfreaks.com/topic/206537-how-to-get-content-of-php-processed-page/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 2, 2010 Share Posted July 2, 2010 $value1 = file_get_contents('http://yourdomain.com/test.php'); // assuming that the allow_url_fopen setting is ON Quote Link to comment https://forums.phpfreaks.com/topic/206537-how-to-get-content-of-php-processed-page/#findComment-1080351 Share on other sites More sharing options...
AbraCadaver Posted July 2, 2010 Share Posted July 2, 2010 I'm not positive how you want to do this, but this is one way: ob_start(); include("test.php"); $output = ob_get_clean(); Quote Link to comment https://forums.phpfreaks.com/topic/206537-how-to-get-content-of-php-processed-page/#findComment-1080369 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.