Accessing Array Elements:
Modifying Array Elements:
Accessing Values in Associative Arrays:
Values in associative arrays are accessed using their corresponding keys
Modifying Values in Associative Arrays:
You can modify values in associative arrays by referencing the key.
Adding New Key-Value Pairs:
To add new key-value pairs, simply assign a value to a new key.
Calling Functions:
You can call a function by using its name followed by parentheses (). If the function has parameters, you need to pass the appropriate arguments within the parentheses.
Returning Values:
Functions can return values using the return statement. This allows you to capture the result of a function and use it elsewhere in your code.
Default Parameter Values:
You can specify default values for parameters in a function. If a value is not provided for a parameter when the function is called, the default value will be used.
Global Scope:
Variables declared outside of any function, at the top level of a PHP script, have global scope. This means they can be accessed from anywhere in the script, including inside functions.
b. String Length:
c. Substring:
a. Uppercase and Lowercase:
b. Searching and Replacing:
C. Trimming and Padding:
D. Formatting:
Basic CRUD operations (Create, Read, Update, Delete):
Below is an example of basic CRUD operations (Create, Read, Update, Delete) using PHP and MySQLi extension. This example assumes you have a MySQL database named example with a table named users having columns id, username, and email.
Create (INSERT):