Topic: Textbox, small unwanted ?new line? problem.
I am running a simple setup. Anybody can write some text into a txt file, and then script will generate an image with the words. I use this as my signature on a discussion board. The script bases the height of the image depending on how many characters are in the txtfile.
The question: If somebody presses ?enter? in the text box, it makes a new line in the txtfile as well. How can i prevent newlines from even being put in? I tried str_replace("\n", "", $str); and a couple of different similar approaches/variations, also truncating, stripping. What would be the best way to prevent new lines ever being put in?
Its funny, when they database information is being displayed on the page of the script(not the image), all lines are ignored. :]
if you want to see the script to understand what i am talking about, its http://www.uniondead.com/index.php?id=shout
to see the generated image http://www.uniondead.com/signature/shout.php
Also, would it save a lot of CPU, to somehow save the image, to avoid generating it over every single time somebody loads the busy forum page?