Advanced PHP Training
- In PHP, you can both create and retrieve cookie values. The setcookie() function is used to set cookies and appears before the <html> tag. The PHP$_COOKIE variable is used to retrieve cookie values.
- Ternary operators are alternative functions to if/else statements, and they free up line space, reducing code clutter and making it easier to debug.
- This involves passing along data from one webpage to another as in the case of a shopping cart. A PHP session is usually started as shown below:
<?php
Session_start();
?>
This code comes before any HTML or text and registers a user's session with a server to begin saving user information.
Cookie Handling
Ternary Operators
PHP Sessions
Source...