Page 1 of 1

How Do I ignore html tags in my text Box Input in php

Posted: Wed Oct 11, 2006 8:49 am
by amir
How Do I ignore html tags in my text Box Input in php

Posted: Wed Oct 11, 2006 8:55 am
by Oren
It depends on what you mean by "ignore"... Do you mean like totally getting rid of them, or converting them something like this?

Code: Select all

<html>

Posted: Thu Oct 12, 2006 9:18 am
by akimm
PHP.net is a wonderful resource friend, i double checked myself for the correct answer here in a matter of 20 seconds.

Code: Select all

<?php
$string = "<h2>" . "hello" . "</h2>";
strip_tags($string);
?>
This code will evaluate string and remove any HTML tags, but let it be know, it also strips PHP from strings, however I believe this is what you want, otherwise, do as Oren said, ASCII safe characters I found this chart here, it should have everything you need:

http://www.web-source.net/symbols.htm