Check out my twitter script by CMXads
Viking gear Gear Gifts and Apparel | Goth and Gore Gifts Shop right now or else! | Evil gear Christmas is almost here | PHP Gallery PHP Gallery is a free php image script. |
here are some of the best and useful php scripts and snippets to help in your projects. Php displayed below. Use the search for specific script lookups. Click the category links to view scripts in Javascript and cgi. To add your own script click the link and add your useful script example.
dynamic menu from delimited file data array return by column index
menu build dynamic column array menu fgetscsv delimited csv file array associative
<?php
function csv_to_array($filename='', $delimiter=';')
{
if(!file_exists($filename) || !is_readable($filename))
return FALSE;
$header = NULL;
$data = array();
if (($handle = fopen($filename, 'r')) !== FALSE)
{
while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE)
{
if(!$header)
$header = $row;
else
$data[] = array_combine($header, $row);
}
fclose($handle);
}
return $data;
}
$this_array= csv_to_array('cart-data2.txt');
//build menu function from temp array PAGE_NAME key value
function recursiveValues($array) {
$menu = '';
$menu .= '<ul>';
foreach ($array as $key => $vals) {//edit your column index keys
$menu .= "<li><a href='?" . $vals['data1'] . "'>" . ucwords($vals['data3']) . "</a></li>\r\n";
}
$menu .= '</ul>';
return $menu;
}
echo $menu= recursiveValues($this_array);
exit;
?>