Is it possible to format text with php as in whenever php sees ~ in text it would put <br>.
I am not sure if it is possible as i am new to php.
Formatting in PHP is quite simple, really.
heres an example of echoing some bold text:
<?php echo "<b>Hello World</b>"; ?>
Also, newlines in PHP (ie <br/>) are output like this:
The above would make:
I hope this has helped you :D
I know how to do that too what i want is for the php to look into what is posted out of DB and find any tildas (~) and put <br> flag there instead of (~).
Now you you understand what i mean as i have no other way of explaing the problem as i am new to php
You might be better to save the actual html to the database, or bbcode. There are plenty of scripts to help automate that. Let us know if you need any pointers.
What kind of script are you talking about as i am unsure what you mean about scripts.
something like this: http://www.isolated-designs.net/core/projects/27/php-bbcode-functions
but it all depends on where the text is coming from and where it's going to.
The other way to get nicely formatted text is to use an htmlarea type of tool. There is a site acting as a directory of them at http://www.htmlarea.com/
Thanks a lot that is exactly what i am looking for...
sorry about that! didn't quite get what you meant!
hope you got it sorted!