ssvarc ssvarc -4 years ago 44
PHP Question

How do I display print_r on different lines?

When I run the following code:


echo $_POST['zipcode'];

print_r($lookup->query($_POST['zipcode']));

?>


the results are concatenated on one line like so:
10952Array
.

How can I get it to display on separate lines, like so:

08701
Array

Answer Source

You might need to add a linebreak:

echo $_POST['zipcode'] . '<br/>';

If you wish to add breaks between print_r() statements:

print_r($latitude); 
echo '<br/>';
print_r($longitude);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download