-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";}
اريد معرفة حل هذه الاكواد وهل هي صحيحة ام لأ؟
تم التعديل في بواسطة Hassan Hedr تنسيق الشيفرة وتوضيح العنوان
السؤال
Ameera Abo Alouf
-phone number must be start with (059) and the length equal 10 character. use preg_match function to do that.
-url field must be like the standard url format use filter_var function to do that.
اريد معرفة حل هذه الاكواد وهل هي صحيحة ام لأ؟
تم التعديل في بواسطة Hassan Hedrتنسيق الشيفرة وتوضيح العنوان
رابط هذا التعليق
شارك على الشبكات الإجتماعية
1 جواب على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.