Current output is print_r for assArray
Array ( [5] => A )
What I think and need it to be is
Array ( 5.jpg => Ash meets Cinderella on her 7th B-day)
Any help is appreciated. Thanks Chuck
Code: Select all
<?php
$text = "image_gallery_description.txt";
//##### Open the file for reading
$fh=fopen($text, 'r');
//##### Loop over the file pointer
while(!feof($fh))
{
//geta a line from file pointer
$line_of_text=fgets($fh);
$parts = explode('|', $line_of_text);
}
if (count($parts[0] == $parts[1]))
{
$assArray= array();
for($i=0; $i<count($parts[0]); $i++)
$assArray[$parts[0][$i]] = $parts[1][$i];
}
echo "print_r for assArray<br />";
print_r($assArray);
echo "<br /><br />print_r for parts0 array<br />";
print_r($parts[0]);
echo "<br /><br />print_r for parts1 array<br />";
print_r($parts[1]);
?>1.jpg|Balloon Fiesta
2.jpg|Our Halloween Pumpkin
3.jpg|Converting our garage to a halloween cave
4.jpg|My little ghoulish helpers
5.jpg|Ash meets Cinderella on her 7th B-day