a.php
Code: Select all
$a = 1;
$b = 2;
Code: Select all
require('a.php')
//How can find var is used in file require / include ?
Moderator: General Moderators
Code: Select all
$a = 1;
$b = 2;
Code: Select all
require('a.php')
//How can find var is used in file require / include ?
andyhoneycutt wrote:I'm pretty sure you're looking for the get_defined_vars function. It returns an associative array of all defined variables.
-Andy
i think fopen and search string too hard.Mark Baker wrote:The way to find if a particular variable (e.g. $a) is used in a particular included file (e.g. file1.php) is to open that file in a text editor and search for $a.
Of course, if you're using variable variables, then you won't find it.