-4

I have a File named 1.php and I have another file named index.php

I use

include('index.php');

for including index data. Is there a way i can pass data to index.php file?

Jay Blanchard
  • 33,530
  • 16
  • 73
  • 113

1 Answers1

1

if index.php is inside 1.php , you can do that:

1.php:

<?php $variable = "hello"; 
      include('index.php');
?>

index.php

<?php 
echo $variable; //this will output hello.
?>