Answer the question
In order to leave comments, you need to log in
How to extract variable values of another file without including it?
<?php
header("Location: http://php.net"); #headers_Sent.php
headers_sent($filename, $linenum);
exit;
?>
<?php
$f = fopen('headers_Sent.php', 'r'); #headers_Sent1.php
fread($f, filesize('headers_Sent.php'));
echo $filename;
Answer the question
In order to leave comments, you need to log in
Get the contents of the file as text and parse the desired piece with a regular expression.
return a json array of variables, but what's the point of doing it within the same site?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question