very simple php question,
for example, demo.php just returns a text like this “hello”.
how can i get this text from an another php page ?
UPDATE:
actually i meant page is outputting it like this “print ‘hello’;”
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.
Does it
return "hello", does it outputhelloor does it simply containshello? All three scenarios are different problems.If it
return "hello";as such:then you can easily grab its value by including the file and grabbing the return value:
If it outputs
helloas such:you must use output buffering to capture the result:
If it contains
helloas such:you can simply read the result:
See Also:
include()PHP Documentation Pagefile_get_contents()PHP Documentation Page