php Flashcards
(127 cards)
Q1: What does PHP stand for?
A: PHP stands for Hypertext Preprocessor.
Q2: Is PHP a client-side or server-side language?
A: PHP is a server-side scripting language.
Q3: What are PHP files saved as?
A: PHP files have a .php extension.
Q4: What platforms does PHP support?
A: PHP runs on Windows, Linux, Mac, etc.
Q5: Name two popular web servers PHP supports.
A: Apache and IIS.
Q6: Can PHP work with databases?
A: Yes, PHP supports databases like MySQL.
Q7: What can PHP do with files?
A: PHP can create, open, read, write, and delete files.
Q8: How is PHP used in forms?
A: It collects form data and processes it.
Q9: How is PHP code executed?
A: On the server, and HTML is sent to the browser.
Q10: What is PHP mainly used for?
A: Building dynamic web applications.
Q1: What is the basic syntax for PHP?
A: <?php to start, ?> to end.
Q2: Are PHP keywords case-sensitive?
A: No, but variables are case-sensitive.
Q3: How do you write a single-line comment?
A: Using // or #.
Q4: How do you write multi-line comments?
A: Using /* */.
Q5: How should a PHP variable start?
A: With a $ followed by a letter or underscore.
Q6: Can a PHP variable start with a number?
A: No, it must start with a letter or underscore.
Q7: What are valid variable names in PHP?
A: $name, $_age, $user123.
Q8: What happens if PHP code contains an error?
A: It may show a blank page or error message.
Q9: What does echo do in PHP?
A: Outputs data to the screen.
Q10: What symbol is used for variables in PHP?
A: The $ sign.
Q1: What are the main data types in PHP?
A: String, Integer, Float, Boolean, NULL, Array, Object.
Q2: What is a string in PHP?
A: A sequence of characters (e.g., “Hello”).
Q7: What is an array in PHP?
A: A collection of values stored under one name.
Q8: What are the types of arrays in PHP?
A: Indexed, Associative, Multidimensional.