Here is my php code:
There is a folder called uploads, in this folder there are different mp3 files. For each mp3 file there is an raf file with the same name. My code creates a table starting with the name of the mp3 file and then lists every line in the assosciating raf file in a new column.PHP Code:<?php
echo '<h2>Existing Files on your account:</h2>';
// Define the full path to the folder whose contents you want to list
$path = "uploads/";
// Open the directory
$dir_handle = @opendir($path) or die("Error opening $path");
// Loop through the files
echo '<div style="border: 2px solid rgb(0, 0, 0);">';
echo '<table border=1>';
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "index.php" ) { continue; }
if (substr($file,($file - 3)) != "raf") {
//List all mp3 files
echo '<tr>';
echo '<td>';
echo $file;
echo '</td>';
$raffile = fopen(("uploads/" . (substr($file,0,($file - 3)) . "raf")), "r") or exit("Unable to
open file!");
//Output a line of the file until the end is reached
while(!feof($raffile))
{
$cline = fgets($raffile);
echo '<td>';
echo (substr($cline,(strpos($cline,"=") + 1)));
echo '</td>';
}
fclose($raffile);
echo '</tr>';
//List all mp3 files
}
}
echo '</table>';
echo '</div>';
echo '<br />';
echo '<BUTTON onclick="window.close();">Close Window</BUTTON>';
// Close
closedir($dir_handle);
?>
In most of the lines of the file a = sign can be found. I wrote some code to display only the text following the = sign.
There are multiple lines in each raf file that that do not have = signs instead they start with [.
Here is an example of an RAF file:
I do not want to list the [raf]/[ann]/[alc]/[autoplay]/[scheduling]. At the moment the table is listing all these lines but instead of, for example, [raf] it is being listed as raf]. Without the opening [.Code:[raf] audioupdate=03/03/00-12:45:40 audiotype=1 [ann] user=false confirmplay= manualplay=true [alc] level=-3dB [autoplay] mins=0 sequence=true [scheduling] commence= expire= timestart=00:00:00 timeend=24:00:00 daysofweek=127
How do i filter out these lines starting with [?




Reply With Quote