PHP Developers Network
http://forums.devnetwork.net/

cleaning up some output
http://forums.devnetwork.net/viewtopic.php?f=1&t=147854
Page 1 of 1

Author:  Vegan [ Wed Jun 27, 2018 12:29 am ]
Post subject:  cleaning up some output

el code

so I wanted to have each item on a new line

Syntax: [ Download ] [ Hide ]
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

Author:  Christopher [ Wed Jun 27, 2018 12:52 pm ]
Post subject:  Re: cleaning up some output

HTML line breaks:
Syntax: [ Download ] [ Hide ]
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>';  
 

Author:  Vegan [ Wed Jun 27, 2018 3:13 pm ]
Post subject:  Re: cleaning up some output

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?

Author:  Vegan [ Wed Jun 27, 2018 3:25 pm ]
Post subject:  Re: cleaning up some output

curious after adding echo $nbsp; which did not render, removing it seems to have fixed it, bizzare effect

Author:  Vegan [ Wed Sep 19, 2018 2:58 pm ]
Post subject:  Re: cleaning up some output

after a few updates it seems to be working fine now, wonder if there was something wrong in wordpress....

Author:  Christopher [ Wed Sep 19, 2018 10:07 pm ]
Post subject:  Re: cleaning up some output

Well, at least it is working now...

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/