Forum Moderators: coopster
---->
while ($data = fgetcsv ($handle, 700 , "¦")) {
$num = count ($data);
$catnaam[$row]=$data[0] ; $catkeyword[$row]=$data[1] ;
if ( $weergave == 1 ) {
echo $row . " - " . $catnaam[$row] . " <b>keywords:</b> " . $catkeyword[$row] . "<br>" ;
}
elseif ( $weergave == 2 ) {
echo $row . " - " . $catnaam[$row] . "<br>\n" ;
}
else { if ( $weergave == 0 ) { echo $catnaam[$row] . "<br>\n" ;
}}
$row++;
}
<---
this script shows the $catnaam var , but reads?/shows? only the first character of the $catkeyword?¿?¿
I'me guessing it's a painfully easy typo mistake?
or isn't?
Maybe try something like below to see if the data coming from the file is ok
echo "<br>",$data[0],":",$data[1];
or
print_r($data);
put one of those right after the while loop to see if it is reading the proper data.
Things to look at
1. the actual data - the lines you posted look fine
2. the initial read - dumping the data as above will show you what is going into the vars, you may also not be getting enough data from each line and could try using a larger number in your fgetcsv function. It should always be longer than the longest line of data.
3. your assignments ie. are you grabbing the right data
4. your output function - looks ok as well
i've written another page where i would need this list, and it workes fine too.
The difference between the two pages, is that the $catnaam is used, and that i opend, appended too, and closed the .txt file, before the include re-opens it, to display the list as shown above.