How-to articles, tricks, and solutions about PHP
Accessing session from TWIG template
In a TWIG template, you can access the session data by using the app.session variable.
Add 30 days to date
In PHP, you can add 30 days to a date by using the DateTime class and the modify() method.
Add 30 seconds to the time with PHP
You can use the strtotime function in PHP to add a specified number of seconds to a given time.
Add data dynamically to an Array
To add data dynamically to an array in PHP, you can use the $array[] = $value syntax.