I want to include the content from a php file into another php file. (It's in a wordpress site)
Include or require won't work because it's just including the file, I need the content itself.
file_get_contents is also not working because it just displays my php code and does not execute it.
what function do I have to use?
I don't fully understand your question either, but I think this might work for you:
$contents
will now contain the 'contents' (the output) of your PHP script.Pause. What? Include includes the code in the file for you. I'm sure this is what you want. For instance, see the code below.
test.php
hasvars.php
included in it and its able to echo the variables fromvars.php