Web Development With PHP
Web Development With PHP - Important Points
1. | Which of the following is NOT a web development language? |
---|
A. PHP
B. HTML
C. CSS
D. Java
View Answer Discuss Work SpaceAnswer: option d
Explanation:
While Java is a programming language used for building applications, it is not typically used for web development.
2. | Which PHP function is used to establish a connection to a MySQL database? |
---|
A. mysql_connect()
B. mysqli_connect()
C. pdo_connect()
D. sql_connect()
View Answer Discuss Work SpaceAnswer: option b
Explanation:
The mysqli_connect() function is used to connect to a MySQL database in PHP.
3. | Which of the following is NOT a way to run PHP scripts? |
---|
A. Through a web server
B. Through a command line interface
C. Through a standalone interpreter
D. Through a database management system
View Answer Discuss Work SpaceAnswer: option d
Explanation:
While a database management system may use PHP scripts, it is not a way to run them.
4. | Which of the following is a valid way to comment out code in PHP? |
---|
B. # This is a comment
C. // This is a comment
D. /* This is a comment /
View Answer Discuss Work SpaceAnswer: option d
Explanation:
The / and */ characters are used to comment out multiple lines of code in PHP.
5. | Which PHP function is used to output text to the web page? |
---|
A. echo
B. print
C. printf
D. write
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The echo function is used to output text to the web page in PHP.