In spite of allowing direct access to individual array element, PHP also provides various other interesting ways to deal with arrays. In particular, there are functions that make it very easy and efficient to use a PHP array as a stack or as a queue.
Code snippets are always useful which saves your precious time and also increase productivity. Today, I’m sharing some super useful PHP code snippets that I’ve collected over the past months.
Whether you’re novice or experienced PHP programmer, PHP.ini configuration is essential. It’s an important configuration file that is used to customize behaviour of PHP at runtime. When PHP server starts up it looks for PHP.ini file first to load various values for settings.
Regular expression is really very useful which allows search, validation, finding, identifying or replacing text, words or any kind of characters. Here in this post, I’ve listed 15+ useful PHP regular expressions and functions that might be helpful for any PHP developer.
When writing PHP scripts that need to deal with the file-system to change the current directory, creating new directories, change the root directory, gets the current working directory, list files and directories inside the specified path and many more. For this, PHP provides a number of built-in directory functions that can be used to perform such tasks.
PHP, as most of us know, has weak typing. What this means is that variable types are determined by context. It’s not always obvious what type a given variable is at any one time. It determines the types of variables and converts them as per requirement.
When developing with Magento I have maintain a library of most used code snippets. These code snippets are very useful when developing theme or custom module since they save your precious time. You can just use this code snippet as it is without making any major change. Here I’m sharing those super useful Magento snippets that I’ve collected over the past year. Enjoy!
Most of modern websites are using sessions to control the experience for individual users, and to maintain state between requests (since HTTP is a stateless protocol after all). Sessions are fantastic and incredibly useful, but if managed incorrectly they can expose your website to security vulnerabilities and potentially allow a malicious attacker to gain unauthorized access to user accounts.