I’m hoping I’m just missing something obvious here… I’m trying to figure out why it seems like PHP variables are being “lost” in the same file. The code of my project can be seen here.
Basically I dumbed it down to declaring a simple variable at line 27 and at line 120 I pull it into $data. $data is stored in the created file and in every case, $i is null.
This is bizarre!
May someone please, please help?
Thanks!
You seem to be writing PHP files in PHP. This is not just a bad idea, it’s downright dangerous.
(Self-writing code is the first step to the robot apocalypse!)The reason
$iis null is because you are not passing the variable in any way. Just writing$ito a file doesn’t magically make$ikeep the value it had before.Have a serious think about what
the hellyou’re trying to do…