| | |
Text formatting With PHP
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Formatting in PHP is quite simple, really.
heres an example of echoing some bold text:
[PHP] <?php
echo "<b>Hello World</b>";
?>[/PHP]
Also, newlines in PHP (ie <br/>) are output like this:
[PHP]echo "Hello\nWorld"[/PHP]
The above would make:
Cheers
heres an example of echoing some bold text:
[PHP] <?php
echo "<b>Hello World</b>";
?>[/PHP]
Also, newlines in PHP (ie <br/>) are output like this:
[PHP]echo "Hello\nWorld"[/PHP]
The above would make:
HelloI hope this has helped you
World
Cheers
Well, if you have a string, and you want to replace parts of that string with another string, maybe you should search for a PHP command to replace strings.
str_replace()
str_replace()
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.
Sarah
Sarah
something like this: http://www.isolated-designs.net/core...code-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/
S
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/
S
![]() |
Similar Threads
- text field values to php variable....... (PHP)
- How to insert text formatting options and smiley tags in website (PHP)
- Can a text link pass php variables? (PHP)
- Roating testimonials (text) in PHP (PHP)
Other Threads in the PHP Forum
- Previous Thread: On The Fly Edit
- Next Thread: PHP Tripod
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array basics beginner binary broken cakephp checkbox class cms code cron curl database date datepart directory display download dynamic echo email error file files folder form forms function functions google head href htaccess html image include insert integration ip java javascript joomla limit link list login loop mail menu mlm mod_rewrite multiple mysql number oop parse password paypal pdf php phpmyadmin problem query radio random recourse recursion regex remote script search seo server sessions sms soap source space sql structure syntax system table tutorial update upload url validation validator variable video web webdesign xml youtube





