My Untitled Deck Flashcards
my desc objectives (29 cards)
- ghg
- khj
* 3.
**
What does the ‘die()’ function do in PHP?
Outputs a message and terminates the script.
True or False: PHP has built-in support for JSON.
True
What is the purpose of the ‘foreach’ loop in PHP?
To iterate over arrays.
Fill in the blank: In PHP, the ___ operator is used for comparison.
== or ===
Which PHP function is used to escape special characters in a string for use in SQL statements?
mysqli_real_escape_string()
What is a PHP session?
A way to store information about the user across multiple pages.
Which control structure in PHP is used for conditional execution?
if statement
What is the difference between ‘include’ and ‘require’ in PHP?
‘include’ will emit a warning if the file is not found, while ‘require’ will emit a fatal error.
What is the purpose of the ‘echo’ and ‘print’ statements in PHP?
To output data to the browser.
True or False: PHP can interact with various database systems.
True
What does the ‘isset()’ function do in PHP?
Checks if a variable is set and is not NULL.
Fill in the blank: The ___ statement is used to create a loop that executes a block of code a specified number of times.
for
Which PHP function is used to get the length of a string?
strlen()
What is the default file extension for PHP files?
.php
ss What operator is used for concatenation in PHP?
.
What is the purpose of the ‘mysqli’ extension in PHP?
To access MySQL databases.
True or False: PHP supports object-oriented programming.
True
What type of data structure is an associative array in PHP?
A collection of key-value pairs.
Which PHP function is used to start a session?
session_start()
What is the correct way to start a PHP block?
<?php
Fill in the blank: In PHP, arrays can be indexed using ___ keys.
numeric or associative
What is the purpose of the ‘require’ statement in PHP?
To include and evaluate a specified file.
Which function is used to output data to the screen in PHP?
echo