php code
PHP Code:
$sortby = 'name'; $set = 'y'; $number = 0;
$fp = fopen('data.txt','r'); if (!$fp) {echo 'ERROR: Unable to open file.'; exit;}
while (!feof($fp)) { $line = fgets($fp,1024); //use 2048 if very long lines $row++; list ($url, $name, $type, $img) = split ('\|', $line); if ($sortby == 'name') $sortkey = strtolower($name); $col[$row] = array($sortkey, $name, $type, $url, $img); }
fclose($fp);
sort($col); reset ($col);
$arrays = count($col) - 1;
$loop = -1; while ($loop < $arrays) { $loop++;
if ($col[$loop][2] == "$group") { $number++;
echo ' <td class="td2" valign="top"><div align="center"><a href="http://apps.facebook.com/fluff/fluffbook.php?id='.$col[$loop][3].'">'.$col[$loop][1].'<br><img src="pets/'.$col[$loop][4].'.png" width="110" class="'.$number.'"></a></div></td> '; if(($number % 4)==0) { echo "</tr>"; echo "<tr>"; } }}
In some of the names in the data file they have special charactors like
♥
☆
蛙
but when my code reads in the database it shows them as
♥
☆
è›™
how can I fix this?
Last edited by simster : 05-21-2008 at 07:22 PM.
|