I need to load a PHP file into a variable. Like include();
I have loaded a simple HTML file like this:
$Vdata = file_get_contents("textfile.txt");
But now I need to load a PHP file.
I need to load a PHP file into a variable. Like include();
I have loaded a simple HTML file like this:
$Vdata = file_get_contents("textfile.txt");
But now I need to load a PHP file.
If your file has a return statement like this:
<?php return array(
'AF' => 'Afeganistão',
'ZA' => 'África do Sul',
...
'ZW' => 'Zimbabué'
);
You can get this to a variable like this:
$data = include $filePath;