-phone number must be start with (059) and the length equal 10 character. use preg_match function to do that.
$phone=$_POST['phone'];
if(!preg_match('/^[0][5][9]+[1-9][0-9]{10}$/',$phone)){
echo "phone number must be start with (059) and the length equal 10 character!";}
}
-url field must be like the standard url format use filter_var function to do that.
$URL=$_POST['URL'];
if(!filter_var($URL,FILTER_VALIDATE_URL)){
echo "enter a valid URL address";
}
اريد معرفة حل هذه الاكواد وهل هي صحيحة ام لأ؟