Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have this code below, I want to add 2 arrays inside it, first array for valid phone number, and the second array for invaild

I have this code below, I want to add 2 arrays inside it, first array for valid phone number, and the second array for invaild phone number like the arrays below, then by using preg_match and foreach loop throw the arrays, if the user input phone number matching the patterns in validphone array like 253.345.5468 print "phone is valid", and if the user input phone number matching the patterns in InValidIphone array like "205-.655-8184" print phone not valid, so the validation here for the patterns in the arrays by php regular expression , please help me with that by php, Thanks

the arrays :

1 - $validIphone=["2534441234","253-434-1234","253.345.5468", "(235) 908 3456"]; 2- $inValidIphone=["(235)-444-1234","(253-434-1234","253)12345678","206-.755-8180","206-4948181","2065438-987","253 345 )5342"];

My Code :

Phone Number Validation
Enetr phone Number

image text in transcribed

image text in transcribed

YEAH MATCH!!! Test another phone number Phone number: 253-444-5555 Go! * Sorry that's not a valid phone number Test another phone number Phone number: 253)444-5555 Go

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

Define the goals of persuasive speaking

Answered: 1 week ago