• Hey guys,

    Anyone know why this isn’t working?

    <?php $variable = get_include_contents((TEMPLATEPATH . '/assets/coverage/commercialEPCandSAPcoverage.php'));?>

    Thanks,
    L

    PS. It’s not my file path. I’m assuming TEMPLATEPATH confuses matters.

Viewing 1 replies (of 1 total)
  • Thread Starter ldexterldesign

    (@ldexterldesign)

    <?php
    $string = get_include_contents(TEMPLATEPATH . '/assets/coverage/commercialEPCandSAPcoverage.php');
    
    function get_include_contents($filename) {
        if (is_file($filename)) {
            ob_start();
            include $filename;
            $contents = ob_get_contents();
            ob_end_clean();
            echo $contents;
        }
        return false;
    }
    
    ?>

    Seems to have solved this one.

    L

Viewing 1 replies (of 1 total)
  • The topic ‘Pulling the contents of an include file into a variable?’ is closed to new replies.