Jump to content

Problems with file_get_contents


Auriga

Recommended Posts

Hi,

i have a problem with relative paths... I'm using the following:

function get_contents() {
$filename = "../images/testimg.png";
$filecontents = file_get_contents($filename);
return $filecontents;
}

When i try to run it, it says that the file cannot be found. However, I'm sure that it's placed in

/images/

whereas the function above is located in

/library/

Even when I replace the relative paths with absolute paths, i still get the error:
$filename = "/images/testimg.png";


I don't see what I'm doing wrong... Is there something that i don't see?

Thanks!
Link to comment
https://forums.phpfreaks.com/topic/34771-problems-with-file_get_contents/
Share on other sites

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.