php - loop through an anchor id -


i apologize of not right, first time asking question on site.

i creating webpage using html, css, , php. specifically, trying create subnavigation links on page using information database.

here code have:

foreach ($subarr $sub => $result) {     if (mysql_num_rows($result) > 0)     {        $resultstring .= '<a id="$sub" style="cursor: poimter; color: #0076cf;" href="$sub">'.'  |  '.$sub.'  |  '.'</a>';     }  } 

$subarr array of subcategories user able click on link subcategory's name , take them part of same page. of right now, create 1 giant link under of subcategory names instead of creating each individual link.

obviously need sort of loop, not sure how through $resultstring change both anchor id , href.

any appreciated!!

(of topic, important)

you have typo, should :

style="cursor: pointer; ..." 

instead of :

style="cursor: poimter; ..." 

Comments