cuboidgraphix Posted April 21, 2008 Share Posted April 21, 2008 Hi Is there a way to only print out the values in an array, line by line? I have this script: <?php $hlr = fopen("hlr.txt","r"); if(!$hlr) { print "error! HLR file could not be opened"; exit; }else{ $array1 = explode("/n", fread($hlr, filesize("hlr.txt"))); print_r($array1); } print "<br />"; $vlr = fopen("vlr.txt","r"); if(!$vlr) { print "error! VLR file could not be opened"; exit; }else{ $array2 = explode("/n", fread($vlr, filesize("vlr.txt"))); print_r($array2); } print "<br />"; $diff = array_diff($array1, $array2); print_r($diff); ?> But I get the output like ..: Array ( [0] => 1 2 3 4 5 6 7 8 9 10 11 12 13 ) Array ( [0] => 4 5 6 ) Array ( [0] => 1 2 3 4 5 6 7 8 9 10 11 12 13 ) Is there a way to only get... 1 2 3 4 etc. ??? Please help. Link to comment https://forums.phpfreaks.com/topic/102196-array-printouts/ Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 foreach ($array as $value) { echo $value . "<br />"; } Just put in the right array name (leave the $value thing). Link to comment https://forums.phpfreaks.com/topic/102196-array-printouts/#findComment-523108 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.