Hi patrilia,
Let´s say $input is the variable which is passed from the form:
- Convert $input into an array!
$array_to_check=explode(".",$input); //see manual for details on explode()
- Now asuming that we have a correct input $array_to_check[0] should be "www"
check it like:
if($array_to_check=="www"){ // do whatever you want here....
// you know the rest....
- To check if the .com ending is there, check the last entry of $array_to_check:
$i=count($array_to_check);
if($array_to_check[$i]=="com"){ // do whatever you intend to do....
Hope that helped...
FAB