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? Quote 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 Quote 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 Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.