justlukeyou Posted August 18, 2013 Share Posted August 18, 2013 Hi, I have been trying my hand at MySQLi but I have noticed a frustrating space appears after the echo. The below code adds a space between the discount and the percentage sign so it appears as 32 % instead of 32%. I have tried removing all the spaces in the code but it still appears. Can anyone advise how to remove this space? Save <?php printf("%s\n",$row["discount"]);?>%<br /> Quote Link to comment https://forums.phpfreaks.com/topic/281298-very-frustrating-space-after-mysqli-echo/ Share on other sites More sharing options...
0xMatt Posted August 18, 2013 Share Posted August 18, 2013 Save <?php printf("%s",$row["discount"]);?>%<br /> Quote Link to comment https://forums.phpfreaks.com/topic/281298-very-frustrating-space-after-mysqli-echo/#findComment-1445650 Share on other sites More sharing options...
kicken Posted August 18, 2013 Share Posted August 18, 2013 \n is a new line, which a browser will render as a space. That is what is causing your issue. Quote Link to comment https://forums.phpfreaks.com/topic/281298-very-frustrating-space-after-mysqli-echo/#findComment-1445678 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.