How to make array Clean looking PHP

Making an ugly looking array to nice looking.

Array is looking like this:

$array = Array ( [book] => Array ( [0] => Array ( [name] => Java [author] => Rao [@attributes] => Array ( [x] => 1 [y] => 2 ) ) [1] => Array ( [name] => Php [author] => Naidu [@attributes] => Array ( [x] => 12 [y] => 20 ) ) [2] => Array ( [name] => Xml [author] => Gowda [@attributes] => Array ( [x] => 19 [y] => 29 ) ) ) );

You Want to make like this


Array
(
    [book] => Array
        (
            [0] => Array
                (
                    [name] => Java
                    [author] => Rao
                    [@attributes] => Array
                        (
                            [x] => 1
                            [y] => 2
                        )

                )

            [1] => Array
                (
                    [name] => Php
                    [author] => Naidu
                    [@attributes] => Array
                        (
                            [x] => 12
                            [y] => 20
                        )

                )

            [2] => Array
                (
                    [name] => Xml
                    [author] => Gowda
                    [@attributes] => Array
                        (
                            [x] => 19
                            [y] => 29
                        )

                )

        )

)

So just place you array inside "pre" tags.
Like this :

echo "<pre>";
print_r($array);
echo "</pre>";


Note: Please share your opinion on my post

Post a Comment

Analytics