Philipps Blog

2007/08/28

Output an array as a bullet list.

Filed under: PHP,Snippets — philipp @ 2:04 pm

This function parses an array recursive an creates a bullet list. Maybe is is usefull for somebody


highlight_string(‘
function var_string($var){
if(is_array($var)){
$string = " ARRAY:

    \n\r”;
    foreach($var as $key => $part)
    $string .= “
  • “.$key.” = “.var_string($part).”
  • \n\r”;
    $string .= “

\n\r”;
return $string;
}else{
return $var;
}
}
?>
‘);

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress