Make var_dump look pretty

Posted by tPlummer on Stack Overflow See other posts from Stack Overflow or by tPlummer
Published on 2013-11-06T15:45:24Z Indexed on 2013/11/06 15:53 UTC
Read the original article Hit count: 115

Filed under:
|

I have a simple $_GET[] query var set for showing testing data when pulling down queries from the DB.

<?php if($_GET['test']): ?>
    <div id="test" style="padding: 24px; background: #fff; text-align: center;">

        <table>
            <tr style="font-weight: bold;"><td>MLS</td></tr>
            <tr><td><?php echo KEY; ?></td></tr>
            <tr style="font-weight: bold;"><td>QUERY</td></tr>
            <tr><td><?php echo $data_q; ?></td></tr>
            <tr style="font-weight: bold;"><td>DATA</td></tr>
            <tr><td><?php var_dump($data); ?></td></tr>
        </table>

    </div>
<?php endif; ?>

When I do var_dump, as expected it's this big array string that is all smushed together. Is there a way to add in line breaks at least for this or display the var_dump in a way that's more readable? I'm open to jQuery suggestions on manipulating the string after it's posted.

© Stack Overflow or respective owner

Related posts about php

Related posts about jQuery