voip03 Posted August 13, 2011 Share Posted August 13, 2011 I am trying to print invoice. I have address table and fields are name, street name, county, and postcode. I want the output like Name Address Count Postcode My code is <textarea id="address"> <? echo nl2br($paypalrow['firstName']."\n"); echo nl2br($paypalrow['shipToStreet']."\n"); echo nl2br($paypalrow['shipToCntryCode']."\n"); echo nl2br($paypalrow['shipToZip']."\n"); ?> </textarea> my output ramanan<br /> 142 The avunue<br /> GB<br /> NW9 0UN<br How to remove the '<br/>' from the output? thank you Quote Link to comment https://forums.phpfreaks.com/topic/244696-php-line-break/ Share on other sites More sharing options...
jcbones Posted August 13, 2011 Share Posted August 13, 2011 remove the line break to br function in your code. nl2br() Quote Link to comment https://forums.phpfreaks.com/topic/244696-php-line-break/#findComment-1256834 Share on other sites More sharing options...
voip03 Posted August 13, 2011 Author Share Posted August 13, 2011 thanks jcbones but <if u look at my out put , u can see the '<br/>' . How to remove that word? Quote Link to comment https://forums.phpfreaks.com/topic/244696-php-line-break/#findComment-1256837 Share on other sites More sharing options...
ZulfadlyAshBurn Posted August 13, 2011 Share Posted August 13, 2011 ehy not just use </br> instead of nl2br? echo $paypalrow['shipToZip']."<br/>"; Quote Link to comment https://forums.phpfreaks.com/topic/244696-php-line-break/#findComment-1256840 Share on other sites More sharing options...
voip03 Posted August 13, 2011 Author Share Posted August 13, 2011 I am trying to echo inside the <textarea> so output is like this NW9 0UN<br/> Quote Link to comment https://forums.phpfreaks.com/topic/244696-php-line-break/#findComment-1256844 Share on other sites More sharing options...
ZulfadlyAshBurn Posted August 13, 2011 Share Posted August 13, 2011 ok, i've tried this and its working. change your code to this. <textarea id="address"> <?php echo $paypalrow['firstName']."\n"; echo $paypalrow['shipToStreet']."\n"; echo $paypalrow['shipToCntryCode']."\n"; echo $paypalrow['shipToZip']."\n"; ?> </textarea> Quote Link to comment https://forums.phpfreaks.com/topic/244696-php-line-break/#findComment-1256851 Share on other sites More sharing options...
jcbones Posted August 13, 2011 Share Posted August 13, 2011 ok, i've tried this and its working. change your code to this. <textarea id="address"> <?php echo $paypalrow['firstName']."\n"; echo $paypalrow['shipToStreet']."\n"; echo $paypalrow['shipToCntryCode']."\n"; echo $paypalrow['shipToZip']."\n"; ?> </textarea> Ummm, hmmmm... Quote Link to comment https://forums.phpfreaks.com/topic/244696-php-line-break/#findComment-1256858 Share on other sites More sharing options...
ZulfadlyAshBurn Posted August 13, 2011 Share Posted August 13, 2011 ok, i've tried this and its working. change your code to this. <textarea id="address"> <?php echo $paypalrow['firstName']."\n"; echo $paypalrow['shipToStreet']."\n"; echo $paypalrow['shipToCntryCode']."\n"; echo $paypalrow['shipToZip']."\n"; ?> </textarea> Ummm, hmmmm... thanks to you that i tried out what you actually said. maybe he didnt understand your said o.0 Quote Link to comment https://forums.phpfreaks.com/topic/244696-php-line-break/#findComment-1256861 Share on other sites More sharing options...
voip03 Posted August 13, 2011 Author Share Posted August 13, 2011 Thank you ZulfadlyAshBurn. jcbones! thank you for Ummm, hmmmm... Quote Link to comment https://forums.phpfreaks.com/topic/244696-php-line-break/#findComment-1256873 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.