php mysql category subcategory list link : <p>I want to like this</p>

<p>Category1</p>

<p>--Subcat1</p>

<p>--Subcat2</p>

<p>Category2</p>

<p>--Subcat2</p>

<p>I have two tables tbl_cat and tbl_subcat</p>

<p>tbl_cat(id,cat_name)</p>

<p>tbl_subcat(id,<strong>cat_id</strong>,subcat_name) </p>

<blockquote>
  <p>cat_id=tbl_cat.id</p>
</blockquote>

<p>how to I write the function and display the category and sub-category link </p>
