Jump to content

Importing a .txt file into an array


morningside

Recommended Posts

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);

?>

Link to comment
https://forums.phpfreaks.com/topic/246762-importing-a-txt-file-into-an-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.