Jump to content

[SOLVED] Parse the contents of a file


mr_mind

Recommended Posts

I have a function that looks like this:

 

function load_module($module) {
$module_contents = file_get_contents("/var/www/localhost/htdocs/new/inc/modules/" . $module . '.php');
return $module_contents;
}

 

but now i need to parse the file that is being called. right now i just see the text that is in the file

Link to comment
https://forums.phpfreaks.com/topic/80776-solved-parse-the-contents-of-a-file/
Share on other sites

I have a function that looks like this:

 

function load_module($module) {
$module_contents = file_get_contents("/var/www/localhost/htdocs/new/inc/modules/" . $module . '.php');
return $module_contents;
}

 

but now i need to parse the file that is being called. right now i just see the text that is in the file

If you want to parse that contents the php file you'll need to use a http address and not a local address eg:

$module_contents = file_get_contents("http://localhost/new/inc/modules/" . $module . '.php');

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.