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...
Writing data to a file using Python Writing data to a file in Python can be done in a variety of ways, depending on the file type and how you want to save the data. Here's a general guide to common formats. 1. Writing Text to a Plain Text File # Writing text data data = "This is some text data." # Open a file in write mode ('w') and write data with open("output.txt", "w") as file: file.write(data) 2. Writing Data to a CSV File import csv # Data to write data = [ ["Name", "Age", "City"], ["Rajesh", 25, "India"], ["Shaun", 30, "San Francisco"], ["Afzal", 35, "Chicago"] ] # Writing to a CSV file with open("output.csv", "w", newline="") as file: writer = csv.writer(file) writer.writerows(data) 3. Writing Data to a JSON File import json # Data to write data = { "Name": "Alice", ...
Update and Delete Record Using PHP and MySQL UPDATE Query : To Update data in your Database Syntax: UPDATE Table_name SET column=value WHERE other_column = other_value DELETE Query To delete the record from your Database To delete the data frothe m database you should use the DELETE query, the syntax is given below: DELETE FROM Table_name WHERE column = value HAPPY CODINGš
Comments
Post a Comment