Jump to content


Photo

removing html?


  • Please log in to reply
2 replies to this topic

#1 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 09 October 2006 - 05:05 AM

if a string contains html code, how do you output without it? for example:
<?php
$string = "<b>hi</b>";
echo $string;
?>

the string wont be bold, it will just be 'hi' without the bolding.

#2 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 09 October 2006 - 05:39 AM

Take a look at strip_tags

just do something like this

$string = strip_tags('<b>hi</b>');
echo $string;

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#3 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 09 October 2006 - 06:02 AM

Oh, ok.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users