I have a PHP script that and at a certain point i want to include another script, but i want the script to run as if it is apart of the original file and doesn’t have to be called by a function or a class:
if(strpos('X-Mailer: Microsoft Outlook', $raw_headers)) {
include 'outlookImageParse.php';
outlookImageParse($html_part);
but the included script doesn’t work even when i define it as a function in that file and call it from the original. I’ve used, require, require_once, include_once, but none perform as how i want it to. What to do to get what i’m trying to achieve?
When you
include()(or require, etc) the script is treated as if it were dropped directly into the file, exactly where yourincludewas – see the following example.file1.phpfile2.php