The Little Guy Posted April 2, 2010 Share Posted April 2, 2010 I am writing a script for the command line, and cant figure out why this is happening.... I have this, and it works, just displays wrong: fwrite(STDOUT, "What do you want to name the table? "); $tblName = fgets(STDIN); echo 'Table '.$tblName.' created.'; it displays like this: Table blocks created. If I do this with a trim: fwrite(STDOUT, "What do you want to name the table? "); $tblName = trim(fgets(STDIN),"\n"); echo 'Table '.$tblName.' created.'; it displays this: created.cks So basically, I want it to display the first example, but have it on one line. How can I fix it? Link to comment https://forums.phpfreaks.com/topic/197381-remove-new-line/ Share on other sites More sharing options...
The Little Guy Posted April 2, 2010 Author Share Posted April 2, 2010 nevermind, I got it. It is not \n it needs to be \r\n Link to comment https://forums.phpfreaks.com/topic/197381-remove-new-line/#findComment-1036003 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.