$line) $total_lines++; $filename = fopen($xml_file,"r"); for ($i = 0; $i < $total_lines; $i++){ ($data = fgetcsv($filename, 1000, "\t")); $total_fields = count($data); $new_array[] = $data; } fclose ($filename); $keywords = array(); $tags = array(); $vacio = 0; $rec_total = 0; //loop for selecting only data bewteen the tag elements -it starts at the 3rd position and increments by 3 for ($i = 3; $i < $total_lines; $i+=3){ //$keywords[] = $new_array[$i][0]; $temp = $new_array[$i][0]; $temp = str_replace(";", "", $temp); $temp = str_replace("", ".", $temp); $temp = str_replace("", "", $temp); $temp = str_replace("", "", $temp); $temp = str_replace(" & ", " and ", $temp); if ($temp !== ".") { $keywords[] = $temp; } else{$vacio++;} //$keywords[] = $temp; $rec_total++; } $total = count($keywords); //print_r($keywords); foreach($keywords as $keyword) { $words = explode(";", $keyword); $words = str_replace("&", "", $words); foreach($words as $word) { //$word = strtolower($word); $word = ltrim($word); if ((isset($tags[$word])) and ($tags[$word]!==" ")) { $tags[$word] += 1; } else { $tags[$word] = 1; } } } ksort($tags); // sort by key a,b...z -important for display ?> Browse by subject
".$title.""; return($a); } // Use array_map to modify the array by adding the links $format_array = array_map("AddLinks", $alphabetical_array); ?>
Browse by subject"; echo "
"; echo implode(" | ", $format_array); echo "
"; ?>
$value) { echo "

[ " . strtoupper($value) . " ]

"; $nuevo = alpha_search($tags, $value); foreach ($nuevo as $value) { $search_tag = str_replace(" ", "%20", $value); ?> • 

Back to top