How-to articles, tricks, and solutions about PHP
How to send HTTPS posts using php
To send an HTTPS POST request using PHP, you can use the curl extension.
How to get the OS on which PHP is running?
You can use the php_uname() function to get the operating system on which PHP is running.
Limit array to 5 items
You can use the "array_slice" function in PHP to limit an array to a specific number of items.
PHP subtract 1 month from date formatted with date ('m-Y')
You can use the DateTime object in PHP to subtract one month from a date formatted with date('m-Y').
How to assign an array within a smarty template file?
In a Smarty template file, you can assign an array to a variable using the assign function.
Add 30 days to date
In PHP, you can add 30 days to a date by using the DateTime class and the modify() method.
Submit html table data with via form (post)
Here is an example of how to submit an HTML table data via a form (using the POST method) using PHP:
Creating anonymous objects in php
In PHP, anonymous objects can be created using the new class syntax.
How to disable output buffering in PHP
In PHP, you can disable output buffering by calling the ob_end_flush() function or flush() function.
How to create new property dynamically
In PHP, you can create a new property for an object dynamically by using the magic method __set.
PHP header location-redirect doesn't work - why?
There are several reasons why a PHP header location redirect may not work: