I want to be able to send a few variables to a file through file_get_contents()
.
This is firstfile.php:
<?php
$myvar = 'This is a variable';
// need to send $myvar into secondfile.php
$mystr = file_get_contents('secondfile.php');
?>
This is secondfile.php:
The value of myvar is: <?php echo $myvar; ?>
I want the variable $mystr
to equal 'The value of myvar is: This is a variable'
Is there any other function that will let you do this in PHP?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…