morningside Posted September 9, 2011 Share Posted September 9, 2011 Hello I am tring to import a .txt file into an array. I am stuck will somone please help me. ?<php $fp = fopen("ArrayTestFile.txt", 'wb'); $X = fread("ArrayTestFile.txt" 'w'); for ($j = 0 ; $j < 6 ; ++$j) { $written = fwrite($fp, "ArrayTestFile.txt"); if ($written == FALSE) break; } print $fp[0] . " " . $fp[1] . " " . $fp[2] . " " . $fp[3] . " " . $fp[4]; fclose($fp); ?> Quote Link to comment Share on other sites More sharing options...
voip03 Posted September 9, 2011 Share Posted September 9, 2011 Try explode http://www.homeandlearn.co.uk/php/php10p7.html Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted September 9, 2011 Share Posted September 9, 2011 file() does this automatically. Quote Link to comment Share on other sites More sharing options...
voip03 Posted September 9, 2011 Share Posted September 9, 2011 http://www.phpfreaks.com/forums/index.php?topic=343514.msg1620818#msg1620818 Quote Link to comment 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.