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 /> 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 /> 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. 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
Archived
This topic is now archived and is closed to further replies.