rockinaway Posted July 25, 2011 Share Posted July 25, 2011 I have a file, php1, that has an array in it (that is ALL it has). I have a second file php2. I want to be able to open/access php1 from php2 and then get the array in php1. I want to take this array and then loop through it in php2. Is there any way of doing this? Link to comment https://forums.phpfreaks.com/topic/242747-how-to-read-a-file-with-an-array/ Share on other sites More sharing options...
Muddy_Funster Posted July 25, 2011 Share Posted July 25, 2011 look into the include_once function Link to comment https://forums.phpfreaks.com/topic/242747-how-to-read-a-file-with-an-array/#findComment-1246793 Share on other sites More sharing options...
LeadingWebDev Posted July 25, 2011 Share Posted July 25, 2011 if it is remote server, use fgetc() then eval() on code u received, if it is located on same server u are working on, user require_once if the files is critical for you, otherwise include_once hth Link to comment https://forums.phpfreaks.com/topic/242747-how-to-read-a-file-with-an-array/#findComment-1246797 Share on other sites More sharing options...
rockinaway Posted July 25, 2011 Author Share Posted July 25, 2011 Okay thanks, done Link to comment https://forums.phpfreaks.com/topic/242747-how-to-read-a-file-with-an-array/#findComment-1246800 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.