PDF Notes: Module PHP version finale

    Master this deck with 40 terms through effective study methods.

    Generated from uploaded pdf

    Created by @beni

    What is PHP?

    A server-side scripting language for dynamic web pages.

    How do static sites differ from dynamic sites?

    Static sites do not update content automatically, while dynamic sites do.

    What is the purpose of the PHP tags?

    To embed PHP code within HTML.

    What does the 'echo' statement do?

    Displays text or variables on a web page.

    What is a variable in PHP?

    A temporary storage for information in memory.

    How is a variable defined in PHP?

    By using the '$' symbol followed by the variable name.

    What are the types of variables in PHP?

    String, Integer, Float, Boolean, Array, NULL.

    What is a constant in PHP?

    A value that cannot be changed once defined.

    How do you declare a constant?

    Using the define() function.

    What is the purpose of control structures?

    To execute code based on conditions.

    What does the 'if...else' structure do?

    Executes code based on whether a condition is true or false.

    What is a loop in PHP?

    A structure that repeats a block of code multiple times.

    What is the difference between 'while' and 'do/while' loops?

    'While' checks the condition before executing, 'do/while' checks after.

    What is a function in PHP?

    A block of code designed to perform a specific task.

    What does the 'strlen()' function do?

    Returns the length of a string.

    What is an array in PHP?

    A collection of values indexed by keys.

    How do you access an array element?

    Using square brackets with the key or index.

    What is the purpose of forms in PHP?

    To collect user input for processing.

    How do you retrieve form data in PHP?

    Using the $_POST or $_GET superglobals.

    What is the role of the 'include' statement?

    To insert the content of one PHP file into another.

    What is PHP?

    A server-side scripting language for dynamic web pages.

    How do static sites differ from dynamic sites?

    Static sites do not update content automatically, while dynamic sites do.

    What is the purpose of the PHP tags?

    To embed PHP code within HTML.

    What does the 'echo' statement do?

    Displays text or variables on a web page.

    What is a variable in PHP?

    A temporary storage for information in memory.

    How is a variable defined in PHP?

    By using a dollar sign followed by the variable name.

    What are the types of variables in PHP?

    String, Integer, Float, Boolean, Array, NULL.

    What is a constant in PHP?

    A value that cannot be changed once defined.

    What is the purpose of the 'include' statement?

    To insert the content of one PHP file into another.

    What does the 'var_dump()' function do?

    Displays the type and value of a variable.

    What is the role of control structures in PHP?

    To control the flow of execution based on conditions.

    How does the 'if...else' structure work?

    Executes code based on whether a condition is true or false.

    What is a loop in PHP?

    A structure that repeats a block of code multiple times.

    What is the difference between 'while' and 'do...while' loops?

    'While' checks the condition before executing, 'do...while' checks after.

    What is a function in PHP?

    A block of code designed to perform a specific task.

    What does the 'strlen()' function do?

    Returns the length of a string.

    How do you create an array in PHP?

    Using the 'array()' function with key-value pairs.

    What is the purpose of forms in PHP?

    To collect user input for processing.

    How do you retrieve form data in PHP?

    Using the $_POST or $_GET superglobals.

    What is the significance of the 'switch' statement?

    To execute different code blocks based on a variable's value.