-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
  • 34,243
  • 16
  • 77
  • 119
Hailey Ash
  • 19
  • 7

1 Answers1

2

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.
?>