That’s quite an open ended question as you’ve not defined what a valid phone number is.
I assume you have the phone number stored as a String. I also assume you just want to check if the number is a valid format. If this is the case, you probably want to use a Regular Expression to check the format and that the correct number of digits are present.
There are more advanced ways to check the number, for example using Google Phone Library. There is a module for this in the Marketplace.
Hope this helps