a::show PHP 메소드

show() 정적인 공개 메소드

Shows an entire array or object in a human readable way This is perfect for debugging
static public show ( array $array, boolean $echo = true ) : mixed
$array array The source array
$echo boolean By default the result will be echoed instantly. You can switch that off here.
리턴 mixed If echo is false, this will return the generated array output.
    static function show($array, $echo = true)
    {
        $output = '<pre>';
        $output .= htmlspecialchars(print_r($array, true));
        $output .= '</pre>';
        if ($echo == true) {
            echo $output;
        }
        return $output;
    }

Usage Example

예제 #1
0
    function testArrayShow()
    {
        $this->assertEqual(a::show($this->arr, false), '<pre>Array
(
    [cat] =&gt; miao
    [dog] =&gt; wuff
    [bird] =&gt; tweet
)
</pre>');
    }
All Usage Examples Of a::show