PHP
Stores data on the client's machine for tracking or preferences.
Use mysqli_query() and mysqli_fetch_assoc() for result handling.
PHP is a server-side scripting language designed for dynamic web page development.
Stores user data across multiple pages until the session ends.
Start with $, followed by the variable name: $name = "John";.
String, Integer, Float, Boolean, Array, Object, NULL, Resource.
PHP stands for "PHP: Hypertext Preprocessor".
echo is faster; print returns a value (1), allowing use in expressions.
== checks value, === checks value and type.
Includes a file but stops script if the file is missing.
A variable that holds multiple values in a single name.
Use echo or print to output text or variables.
Checks if a variable is empty or not.
Indexed, Associative, and Multidimensional arrays.
$person = ["name" => "John", "age" => 30];
Use mysqli_connect() or PDO for database connections.
Includes and evaluates a file; continues script if file not found.
Call session_start(); at the beginning of the script.
Use //, # for single-line, or /* */ for multi-line comments.
Checks if a variable is set and not NULL.
Use $_GET or $_POST superglobals to collect submitted form data.
Use header("Location: page.php"); followed by exit;.
A superglobal that contains server and execution environment information.
function sayHello() { echo "Hello"; }
Use $_FILES, move_uploaded_file() to process uploaded files.
Copyrights © 2024 letsupdateskills All rights reserved