Hi, ive been stuck on this for a couple days now. I have a text file with the following information. Array ( [source] => H:\server\htdocs\images/9059170.jpg [height] => 150 [width] => 200 ) Array ( [source] => H:\server\htdocs\images/7811639.jpg [height] => 133.090909091 [width] => 200 ) Array ( [source] => H:\server\htdocs\images/6070218.jpg [height] => 133.980582524 [width] => 200 ) I use file() to read the contents into a multidimensional array. $resizedImages = file($file); This way I just call a foreach loop like the following to list the info in my text file. ie. foreach ($imagesResized as $img) { echo "<img src=".$img['source']." height=".$img['height']." width=".$img['width']." border='0'/>"; } The problem is that it only lists "A". Which is of course the first letter of Array. print_r($imagesResized) list the array perfectly. How can I get it to list the the key value pair from a foreach loop, just like you would from a DB? I have exhausted every option I can think of for the arrays function so any help would be appreciated. Any help is greatly appreciated.
print_r is not listing an array because when read in, it's not an array, it's a string that contains "Array ( [source] => H:\server\htdocs\images/9059170.jpg [height] => 150 [width] => 200 )" I suggest storing the individual lines with the function serialize() and retaining the arrays with unserialize() the way you are doing it right now will not work