Hi I am trying to get this code to determin if a filename is in an array with " (lofi)" added in it this is what i have and i "think" i will work but my function is not returning anything
function lofiline($file, $lofifiles) {
$file = substr("$file", 0, -4);
if (in_array("$file (lofi).mp3", $lofifiles)) {
return "<td><a type=\"audio/x-mpegurl\" href=\"play.php?file=http://christianmusiciancoalition.org$url/$file\"><img src=\"images/play.gif\" width=\"15\" height=\"15\" border=\"0\" align=\"absmiddle\"> LO FI Play</a></td>";
}
else {
return "<td><img src=\"images/play.gif\" width=\"15\" height=\"15\" border=\"0\" align=\"absmiddle\">LOW FI Play</td>";
}
}
if($no == NULL) {
foreach ($files as $file) {
$file_short = fileshort($file);
$lofi = lofiline($file, $lofifiles);
print "
<table width=\"100%\" border=\"0\">
<tr>
<td><a type=\"audio/x-mpegurl\" href=\"play.php?file=http://christianmusiciancoalition.org$url/$file\">$file_short </a></td>
</tr>
<tr>
<td><a type=\"audio/x-mpegurl\" href=\"play.php?file=http://christianmusiciancoalition.org$url/$file\"><img src=\"images/play.gif\" width=\"15\" height=\"15\" border=\"0\" align=\"absmiddle\"> HI FI Play</a></td>
</tr>
<tr>";
$lofi;
print "</tr>
</table>
<br />\n";
}
}
else {
echo "$no";
}
but it will not output the lofi line and i do not get any errors when i goto the page
you can see it @ http://christianmusiciancoalition.org/listen.php?txtBandID=9
@ the bottom of the page is the arrays im using please help.
I can put more code up if needed