PHP

Generating XML file for Google Merchant
An example of generating an XML feed for Google Merchant in PHP with a minimum set of required fields.
493
0
Writing and reading files in PHP
Examples of saving and reading text data and arrays to files.
317
0
How to prevent opening a site in an iframe
Several options for how to prevent opening pages of your site in an iframe using htaccess, PHP and JS.
849
0
How to read SSL certificate from PHP
The SSL certificate can be obtained using the Stream Context, and the openssl_x509_parse() function will help to parse...
203
0
List of MIME types
Below is a list of MIME headers and file extensions.
271
0
Seconds to minutes, hours, days
Two PHP functions for converting seconds to days, hours, minutes.
105
0
array_unique for multidimensional arrays
The array_unique function returns an array without duplicate values, and it works with multidimensional arrays as well.
65
0
Disable PHP caching
Sometimes on hostings PHP opcache caching is enabled by default. Edits were made in the code, but on the site everything is displayed as before...
81
0
Checking data with regular expressions
A collection of regular expressions with examples in PHP for validating data from form fields.
110
0
Regular Expression Shortcodes
Often on sites, it becomes necessary to insert dynamic information blocks into the texts of pages - banners, phones...
50
0
Session lifetime in PHP
By default, in php, the session lifetime is only 24 minutes, and cookies are saved until the browser is closed, such parameters are set on many hosting services.
947
0
How to find out if a request came via AJAX
To distinguish between direct and AJAX requests, simply check the value of the $ _SERVER global variable
102
0
How to set up Last-Modified
The Last-Modified header helps to optimize the loading of web pages and make the job easier for search engines.
168
0
Serialize function, possible problems
The serialize () function returns a string representation of any value (array, object, etc.). Using serialize on an...
59
0
Prevent PHP scripts from executing in a directory
If you want to prohibit the execution of php scripts in a directory, for example, in uploads, you need to put the...
141
0
Automatic setting of the user's time zone
date_default_timezone_set sets the default timezone used by all date / time functions.
153
0