Default TemplateGreen TemplateBlue TemplateRed TemplateGold TemplateBlue Gloss Template
Sri Lanka News Categories

Mycities Network
PHP Scripts Examples and Tutorials
Want to display html string as text using php?

Monday Dec 11, 2006
This small code will tell you how to display html code as text using php and also this code will remove the chr13 (breaker points) and it will make all the text as one line. This is good when you are doing the program with JavaScript also.

filename: safmakeoneline.php
 <?
 if ($Submit) {
 $mytext = str_replace(chr(13),"",$mytext);
 print htmlspecialchars($mytext);
 }
 ?>
 
 <form method="POST" action="?">
 <p><textarea rows="158" name="mytext" cols="118"></textarea></p>
 <p><input type="submit" value="Submit" name="Submit"><input type="reset" value="Reset" name="B2"></p>
 </form>

Author: Safras Ahamed



Comments : What do you think about this news?
No Comments yet.

POST COMMENT
Name
Message
  Post will be visible after admins approval
 
Members Login
User ID
Password
    Register
Forgot password?

Sri Lanka Toolbar
Listen to live Sri Lanka Radio, Watch Sri Lanka TV, Search Sri Lanka, Search Google, Sri Lanka New
Download Sri Lanka Toolbar FREE




Join Sri Lanka Banner Exchange | Text Link | Resources - Top Link Exchange