I'm reading a file into an array. I want to assign a checkbox to each line to where the checkbox's name is the array's number.
// set file to read
$file = '/home/damasta/mp3/playlist.lst';
// read file into array
$data = file($file) or die('Could not read file!');
// loop through array and print each line
foreach ($data as $line) {
echo $line;
print "<br>";
}
And I want it to look like this:
$file = '/home/damasta/mp3/playlist.lst';
// read file into array
$data = file($file) or die('Could not read file!');
// loop through array and print each line
foreach ($data as $line) {
echo $line;
print "<input type=checkbox name=array_number_here /><br>";
}
I'm sure there is a way to do this and it's probably really simple. Thanks.