ffdb array displaying help
i have a flat file database that looks like
sitename||siteurl||siteimage||discription||added||removed||reason||valid
mysite||domain.com||path/to/image.jpg||a really cool website||10.10.05|| || ||1
i want to loop through the array echoing the data for the ones that have 1 in the valid spot for my navigation display and only displaying the ones with 1 in the valid spot
then for another page i'd like to display all the data and echo the ones with 0 to be red text and the ones with 1 to be green
i know how to loop through the data outputting it all normally, but not how to check if there is a 0 or 1 in the valid feild then echoing it --current code
PHP:<?php
$Lines = file("data.txt");
foreach($Lines as $Key => $Val)
{
$Data[$Key] = explode("||", $Val);
}
for($K = 0; $K < sizeof($Lines); $K++)
{
echo '<p>';
echo 'sitename: '.$Data[$K][0].'<br>';
echo 'siteurl: '.$Data[$K][1].'<br>';
echo 'siteimage: '.$Data[$K][2].'<br>';
echo 'discription: '.$Data[$K][3].'<br>';
echo 'added: '.$Data[$K][4].'<br>';
echo 'removed: '.$Data[$K][5].'<br>';
echo 'reason: '.$Data[$K][6].'<br>';
echo 'valid: '.$Data[$K][7].'<br>';
echo '</p>';
}
?>
thanks for any help :]
