why do people want to know if there are HTML tags?
Because there are spams using <a href and injections and you name it
if someone
submits, in a form, which i think is the case for the asking person,
1<2, he can be asked not to use '<'
and if he wants to be clever and tell me 1<2
he can say: 1 is less than 2
my code in my first reply
is a very simple way to determine, if is some HTML tags in a string
But to be a bit more secure
we might need to test for
'<'
which is same as '<'
<?php
if ( strstr( $string, '<' ) || strstr( $string, '<' ) )
exit( 'dont use HTML tags, please' );