In php, I open a .php file and want to evaluate some lines. In particular, when the variables $ table_id and $ line are assigned a value.
In a text file I have:
... $table_id = 'crs_class'; // table name $screen = 'crs_class.detail.screen.inc'; // file identifying screen structure ...
among other lines. The above if statement never detects the appearance of $table_id or $screen (even without $ prepended). I canβt understand why it will not work, since the strpos statement below is looking for a βrequireβ job perfectly.
So why is this statement not getting hit?
while ($line=fgets($fh)) { //echo "Evaluating... $line <br>"; **if ((($pos = stripos($line, '$table_id')) === true) || (($pos = stripos($line, '$screen'))===true))** { // TODO: Not evaluating tableid and screen lines correctly fix. // Set $table_id and $screen variables from task scripts eval($line); } if (($pos=stripos($line, 'require')) === true) { $controller = $line; } }
source share