Hi, I want to strip the extension from a filename like- filename.gif i want it to only show- filename
This is the code i have at the moment to get the filename-
PHP Code:
<?php
// ### TOP STATS ########################################
$top_stats = array();
// TOP POSTERS
$top_posters = $db->query_read("SELECT * FROM ".TABLE_PREFIX."attachment ORDER BY counter DESC LIMIT 10");
while($top_poster = $db->fetch_array($top_posters))
{
eval('$top_stats[\'top_posters\'] .= "' . fetch_template('top_posters') . '";');
}
unset($top_poster);
$db->free_result($top_posters);
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_topposters') . '";');
and this is the code i have in the style-
PHP Code:
<tr>
<td class="thead"><span class="smallfont"><a href="http://www.mobileexpert.co.uk/mobile/forum/showthread.php?p=$top_poster[postid]">[$top_poster[filename]]</a></span>
<class="$bgclass"><span class="smallfont"><strong><a> </a>[$top_poster[counter]]</strong></span></td>
</tr>
at the moment it shows the 10 most downloaded files but including the file extension, Anyone know how i can strip the file extension please ?
Cheers
Chris.