- BASICS
- Quotes
- Constants
- Control Structures
- Reference
- Number Systems
- VARIABLES
- Definition
- Variable Variable
- Exists
- Type Casting
- OPERATORS
- Aritmetic
- Bitwise
- String
- Comparison
- Logical
- FUNCTION
- Definition
- Anonymous
- Reference
- Variable Arguments
- ARRAY
- Basics
- Operations
- Create
- Search
- Modify
- Sort
- Storage
- STRING
- String Basics
- String Compare
- String Search
- String Replace
- String Format
- String Regexp
- String Parse
- Formating
- Json
- STREAMS
- File Open
- Read File
- Read Csv
- File Contents
- Context
- Ob_start
- OOP
- Object Instantiation
- Class Constructor
- Interfaces
- Resource Visibility
- Class Constants
- Namespaces
- HTTP
- Headers
- File Uploads
- Cookies
-
Sessions
PHP PAGES -
LEVEL 1
Session
Session is started before loading classes. This makes storing objects in the session impossible.Start
Session can be started from your script. Also, you can start session automaticaly in php.ini
session_start();
session.auto_start = 1
Access
Sessions are used to create persistent client state between request. Sessions are stored on servers, cookies on clients. For accesing date we use $_SESSION.
// Set a session variable
$_SESSION['hide_menu'] = true;
// From here on, we can access hide_menu in $_SESSION
if ($_SESSION['hide_menu']) {}