How to validiating mobile number in csv file?

OK, so you already have the loop described in my post earlier, all you need to do now is add the check to see whether your phone number ($data[0] by the look of it) is exactly ten digits long (or whatever the condition(s)), and only execute the query and increment the counter if they meet that condition.

While you’re at it, might be worth upgraded to mysqli or PDO as the database calls you’re using there are no longer part of the current PHP language.

1 Like

Thank u :slight_smile:

hii Good Morning…

How to validate mobile numbers which only starts from 7,8,9.

Same thing - your validation function would just check that the numbers start correctly and return true or false, and your main loop would look at the return from the function to decide whether to insert them into the database or not.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.