Most Useful PHP Snippets

Here we have some set of Useful PHP Snippets, which are useful for PHP Developers. That you can easily add in your projects and help you save your time. 1) Check if a date today’s date 2) Get image extension 3) ...

Email Validation in CakePHP

Email validation is an important part of any application and especially, when we use email as username in our application and you want to make sure that user enter a valid and unique email address. In CakePHP application we ...

Install CakePHP 3 using Composer

CakePHP CakePHP is a free, open-source, rapid development framework for PHP. CakePHP follows the Model-View-Controller (MVC) software design pattern and makes building web applications simpler, faster and require less code. CakePHP has released 3.x versions with many changes. CakePHP 3.x ...

Generate Random Alphanumeric String with PHP

This is a simple function that allows you to generate random strings containing Letters and Numbers (alphanumeric) using PHP. The random strings can be used for various purposes, including: Referral Code Promotional Code Coupon Code OTP Code This code relies on following ...

How to import large sql files in XAMPP ?

We will use Command-Line Tools (Shell) to import a large database SQL file. 1) Open the XAMPP Control Panel. 2) Make sure Apache and MySQL are running and click the Shell button in the XAMPP Control Panel. ...

There are few easy step Install Composer on Window with XAMPP. Composer Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries according your project requirement and it will ...

array_filter A quick solution to remove empty elements from an array is using array_filter without a callback function. This will also remove blank, null, false, 0 (zero). array_values If you are working with a numerical array and need to re-indexes the ...

Run Stripe Webhooks URL from localhost

Recently I was working on Stripe payment gateway and wanted to test Stripe webhooks on localhost before update code on Live site. Working on localhost and for testing update code on Live site via FTP or Git, in this ...