Say you would like to include the content of script in your code. By passing the variable to the script and returning this value, you can create a truly dynamic entry for your code, without any duplication of effort.
Here’s the breakdown:
- Use an output buffer
- Start the output buffer
- include the file with the passed variable
- store the buffered content in a variable
- stop the buffer.