Using Variables inside file get contents

0 Shamal Sandeep · October 6, 2014
I have a script like this

$int = 1;
$var = "name";

if($int >= 1){
$page = file_get_contents('li.raw')
echo $page;
} else {


 So my li.raw is like follows


    echo $var;

but this does not show name value in the page. I tried without php tags but it doesn't work. any idea how i call $var variable inside the li.raw file ?

Post a Reply


Oldest  Newest  Rating
0 Pieter Moens · October 7, 2014
Have you tried to just include the file?

include 'li.raw';

I don't know, but it might work.

Kind regards,
Pieter Moens
0 Samuel Oloruntoba · October 7, 2014
yeah, just include the file, or you could get the contents and use evel function on the returned output, THIS METHOD IS NOT ADVICED
  • 1



Server-side, HTML embedded scripting language used to create dynamic Web pages.