$xml_file = file_get_contents(SITE_PATH . \'cms/data.php\');
The problem is that a server has URL file-access disabled. I cannot enable it, its a h
If the file is local as your comment about SITE_PATH suggest, it's pretty simple just execute the script and cache the result in a variable using the output control functions :
function print_xml_data_file()
{
include(XML_DATA_FILE_DIRECTORY . 'cms/data.php');
}
function get_xml_data()
{
ob_start();
print_xml_data_file();
$xml_file = ob_get_contents();
ob_end_clean();
return $xml_file;
}
If it's remote as lot of others said curl is the way to go. If it isn't present try socket_create or fsockopen. If nothing work... change your hosting provider.