Page 1 of 1

cleaning up some output

Posted: Wed Jun 27, 2018 12:29 am
by Vegan
el code

so I wanted to have each item on a new line

Code: Select all

echo '<strong>IP Address</strong>:- '.$ip;;
echo '<strong>City</strong>:- '.$city;  
echo '<strong>Country</strong>:- '.$country;  
echo '<strong>Country Code</strong>:- '.$country_code;
echo '<strong>Currency Code</strong>:- '.$currency_code;  
echo '<strong>Latitude </strong>:- '.$latitude;  
echo '<strong>Longitude </strong>:- '.$longitude;  
echo '\n\l' does not work, do does <br> etc etc

using a php plugin to add snippets

Re: cleaning up some output

Posted: Wed Jun 27, 2018 12:52 pm
by Christopher
HTML line breaks:

Code: Select all

echo '<strong>IP Address</strong>:- '.$ip . '<br>';
echo '<strong>City</strong>:- '.$city . '<br>';  
echo '<strong>Country</strong>:- '.$country . '<br>';  
echo '<strong>Country Code</strong>:- '.$country_code . '<br>';
echo '<strong>Currency Code</strong>:- '.$currency_code . '<br>';  
echo '<strong>Latitude </strong>:- '.$latitude . '<br>';  
echo '<strong>Longitude </strong>:- '.$longitude . '<br>';  

Re: cleaning up some output

Posted: Wed Jun 27, 2018 3:13 pm
by Vegan
I tried that and it seems that WP does not accept the line breaks properly. I have also tried PHP_EOL etc.

Wonder if I need to do something more?

Re: cleaning up some output

Posted: Wed Jun 27, 2018 3:25 pm
by Vegan
curious after adding echo $nbsp; which did not render, removing it seems to have fixed it, bizzare effect

Re: cleaning up some output

Posted: Wed Sep 19, 2018 2:58 pm
by Vegan
after a few updates it seems to be working fine now, wonder if there was something wrong in wordpress....

Re: cleaning up some output

Posted: Wed Sep 19, 2018 10:07 pm
by Christopher
Well, at least it is working now...