Smart file_get_contents