I'm making a search function for my website, but I want to block searches that are less then 3 characters
if($search > 3){
header('Location: error.txt');
}
its probably something very simple. please help
You need to use strlen()
to get the characters count.
if(strlen($search) < 3){
header('Location: error.txt');
}