F
F
fapchat2020-01-05 17:50:42
css
fapchat, 2020-01-05 17:50:42

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;

In short, how do I use the $filename variable in another file without redirecting to the php.net site ?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Andrey Okhotnikov, 2019-03-12
@tsepen

Remove the "active" class from the parent block

Y
Yuri Kulaxyz, 2020-01-05
@Kulaxyz

file_get_contents('php.net')?

P
profesor08, 2020-01-05
@profesor08

Get the contents of the file as text and parse the desired piece with a regular expression.

A
Anton Shamanov, 2020-01-06
@SilenceOfWinter

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 question

Ask a Question

731 491 924 answers to any question