I currently store news posts to a blob on mysql
But it does nt detect line breaks.. for example
Hi everyone How are you all? From me
This would come out like this
Any ideas?
nl2br look that up
at least give him a link
http://www.php.net/nl2br
ie.
echo nl2br($variablefrommysqldb);
oops, yep sorry bout that
Top PHP Studio
wtf???
if you want to promote something, put it in your sig, not blatently in a post
lol... RxGx, did you write that program?
Nope. I like it because it's a notepad for PHP. Nice and simple. Make a 14 year-old a moderator, and you get posts like above.
except i'm not 14, and remarks like that will gain you NO friends around here
why don't you try reading the faq's before spouting off like a little kid, we DO have rules here
and don't make it too obvious that you are posting only about that, your post had nothing to do with the thread
n12br()
wtf??? if you want to promote something, put it in your sig, not blatently in a post
This is a real professional and thought-out response. First you loose your temper and then you start making threats about me not making any friends. Is there some hidden agenda you're masked behind? All I did is give a link to a PHP parser, which is the thread topic. In addition, the link goes to a perfectly good and free, i might add, tool for PHP.
I guess whoever has the highest post count in this forum is the best person. We need not heed the ones helping their fellow developers out.
n12br() seem to parser html out... maybe I dont understand it correctly..
Or perhap I explained what I need wrong
I use textarea and insert the info there to a blob
but wheN i display that data it has nt saved the line breaks
If inputted as:
a
b
c
would display as:
a b c
It that the right thing?
$string = n12br($string); That would add spaces when entered in MySQL
if you would read the thread, he obviously named the subject line wrong, and if you think it is pertinent, explain a little, maybe something like
this link is an html parser, it may work for what you want, and once again, read the faq's
Why is everyone typing n12br()? Is it not nl2br()?
Anyway.. when you grab the text from the database, don't modify it. Just echo it out through the aforementioend function.
echo nl2br($myString);
Originally posted by Ravenous Why is everyone typing n12br()? Is it not nl2br()? Anyway.. when you grab the text from the database, don't modify it. Just echo it out through the aforementioend function.echo nl2br($myString); [/B]
Originally posted by Ravenous Why is everyone typing n12br()? Is it not nl2br()? Anyway.. when you grab the text from the database, don't modify it. Just echo it out through the aforementioend function.
[/B]
probably cuz they don't really know about the function or what it really is, and he has been shown your method by me and others already, but he said it doesn't work, though i think he may be trying it before he puts it into the database or something, who knows
soo is it n12br() or nl2br()?
it's nl2br(), as in new-line(\n) to <br>
en-el-two-bee-arrr
cheers worked!