function my_print_r($array){
echo '<ul>';
foreach ($array as $key => $value){
echo '<li>' . $key;
if (is_array($value)){
my_print_r($value);
}
else echo ' : ' . $value;
echo '</li>';
}
echo '</ul>';
}
Hope this will work, just change the formatting as You like :)