newbie in PHP here, sorry for troubling you.
I want to ask something, if I want to include a php page, can I use parameter to define the page which I’ll be calling?
Let’s say I have to include a title part in my template page. Every page has different title which will be represented as an image. So,
is it possible for me to call something <?php @include('title.php',<image title>); ?> inside my template.php?
so the include will return title page with specific image to represent the title.
thank you guys.
An included page will see all the variables for the current scope.
Then in your title.php file that variable is there.
It’s recommended to check if the variable isset() before using it. Like this.
EDIT:
Alternatively, if you want to use a function call approach. It’s best to make the function specific to activity being performed by the included file.