Categories
PHP / MySQL

PHP 7.1 – Symmetric array destructuring

In this post, I will show you how you can use the new Symmetric array destructuring feature of PHP7.1 version. In the previous version of PHP, we used list method to destructure arrays for assignments. The shorthand array syntax ([]) may now be used to destructure arrays for assignments (Including within foreach), as an alternative […]

Categories
Javascript

ECMAScript 2016 – Finding if a value exists in an array using JavaScript

We gonna use ECMAScript 2016’s new includes() method to determine whether an array contains a specific element. The new method includes(searchElement, fromIndex) function searches an array for a specific value and returns the corresponding boolean, return true if it exists otherwise false. An optional argument fromIndex allows to search from a specific index. Let’s see […]

Categories
PHP / MySQL

Remove specific value from array using php?

This post shows the possible ways to remove specific element from array based on value of the element. Removing specific value Using array_diff() Using this method we can remove one or more elements where using other methods we can only remove/delete one element at a given instance. Removing specific value using array_search() Using this method […]

Categories
PHP / MySQL

How to generate excel from array using PHPExcel

This tutorial will describe usage of PHPExcel library to generate an Excel file from PHP array. Usage of PHPExcel library is very simple and easy. Just follow the below steps. 1. First thing first – Download PHPExcel from – http://phpexcel.codeplex.com/ 2. After downloading files Unzip the PHPExcel.zip files and we only need files and directories […]

Categories
Laravel

Logging an Array in Laravel5

In this post, I am going show logging arrays and viewing logged items in the terminal in a very generic way. For this tutorial purpose, we are using laravel 5 and you can use these techniques with any framework. Logging an array is not so straightforward though because PHP will not automatically convert an array […]