Category: PHP

PHP array_push() Function

The array_push() function is used to add one or more elements onto the end of an array. The length of array increases by the number of variables pushed. Tip: You can add one value, or as many as you like. Note: Even if your array has string keys, your added elements will always have numeric […]

Twilio Send SMS using PHP

In a few lines of code, your PHP application can send, receive, and reply to text messages with Twilio Programmable SMS. Download below library file and copy and paste code after setup Account ID, Auth Token, and Twilio Download Library File Code

Simple Session-Based Flash Message

Set the Session just in case  //Ensure that a session exists (just in case) if( !session_id() ) { session_start(); } The rest is as easy as it gets! The Function. /** * Function to create and display error and success messages * @access public * @param string session name * @param string message * @param […]

How to Work Tempdata in Codeigniter

In some projects, where you want to remove data stored in session after some specific unique time period, this can be done using tempdata functionality in CodeIgniter. Steps For How to Work Tempdata in Codeigniter Step 1: Add Tempdata To add data as tempdata, we have to use mark_as_temp() function. This function takes two argument items first […]

Create Captcha using Laravel

Captcha stands for Completely Automated Public Turing test. It is mainly used as a security test to ensure only human users can pass through. Computers or robots are not able of solving a captcha. There are different types of captcha we can use some protection. The logic behind why websites implement CAPTCHA codes into their registration processes is spam. In this example, we can use the […]