icrazybrownie.blogspot.com is a platform that provides you a bunch of information of Software Development. Gives you an ideas about Programming Language,Technology and many more.Happy Coding
Phone Number Validation Using preg_match() Below code shows validation of Phone Number 1)Checking whether user input (Phone Number) contains an alphabet in Phone Number <?php $mobile_no="123fdgdg890"; if(preg_match("/[a-z][A-Z]/i", $mobile_no)) { echo "Invalid Phone Number!"; }else{ echo "Valid Phone Number!"; } ?> Output :Invalid Phone Number! Syntax preg_match("/[a-z][A-Z]/i", $mobile_no) The above syntax will verify whether given phone number is well-formed or not.if it is not, it will show an error message. The preg_match() function helps to find whether a given variable is valid or not. 2 )Checking whether user input (Phone Number) contains 10 digits in Phone Number <?php...
About CSV Comma-separated values are known as CSV. It is the simplest form of storing data in tabular form as plain text. Data Scientists need to know how to work with CSV data because most of their activities involve CSV data.In CSV files, the first line contains the field/feature names. The following lines of the file are observations/records. The values of a record are separated by “comma.” Here we have a file named “annual-energy-survey-demo-csv.csv” using this CSV file, we will try to learn how to read and write the CSV files. In this article, I'll explain in detail how you can read and write CSV files in Python. # Import the csv library import csv # Open the CSV file file = open ( '/content/drive/MyDrive/annual-enpr-survey-demo-csv.csv' ) type ( file ) output: io.TextIOWrapper # Use the csv.reader object to read the CSV file csvreader = csv.reader( file ) # Extract the fields names csv_header = [] csv_header = next (csvreader) print(header) Output:...
Comments
Post a Comment