How about:
text.txt
line1: Dog
line2: Cat
line3: Horse
line4: Bird
line5:
.....
<?php
if (!($fileArray = file("text.txt"))) {
printf("could not read text.txt file");
}
$string_one= $fileArray[0]; //will give you Dog
$string_two= $fileArray[1]; //will give you Cat
?>
or you could loop it:
<?
if (!($fileArray = file("text.txt"))) {
printf("could not read text.txt file");
}
$num=0;
for ($i=0; $i < count($fileArray); $i++) {
echo $string[$num] = $fileArray[$i];
}
?>