How-to articles, tricks, and solutions about ARRAY

How to Empty an Array in JavaScript

This tutorial provides useful information about clearing an existing array in JavaScript. Get familiar to multiple methods and find the best one for you.

How to Extend an Existing JavaScript Array with Another Array Without Creating a New Array

Read this JavaScript tutorial and learn about several useful methods for extending an existing an Array with another array without creating a new array.

How to Find the Min/Max Elements in an Array in JavaScript

Read this JavaScript tutorial and learn about the methods used to find the minimum and maximum number of elements in an array. Find the fastest solution.

How to Find the Sum of an Array of Numbers

Read this JavaScript tutorial and learn several methods used to find or calculate the sum of an array of numbers. Also, find which is the fastest one.

How to Fix the "Invalid Argument Supplied for Foreach()" PHP Error

The "invalid argument supplied for foreach()" is considered a common PHP error. With the help of this tutorial, you will figure out how to resolve it.

How to Fix the Uncaught Error "Cannot Use Object of Type stdClass as an Array"

This short tutorial is dedicated to a common PHP issue "cannot use object of Type stdClass as an array". Read on to find the most accurate solutions.

How to Get All Property Values of a JavaScript Object

Read this tutorial and learn about several methods used for detecting the property values of an object without knowing the key based on specifications.

How to Get the Difference Between Two Arrays in JavaScript

Read this tutorial and learn several JavaScript and jQuery methods that help you get the difference between two arrays easily. Choose the best one for you.

How to Get the First Element of an Array in PHP

This snippet gives you an opportunity to learn how to get the first element of an array using PHP. You can choose among the provided functions.

How to Get the Index of an Array that Contains Objects in JavaScript

Read this JavaScript tutorial and learn several useful, fast and simple methods that are used for getting the index of an array that contains objects.

How to JSON Decode a String into an Array with PHP

This is a short guideline that provides comprehensive information on how to decode a JSON string into an array with the help of PHP.

How to List the Properties of a JavaScript Object

Read this tutorial and learn useful information about the two popular built-in methods that are used for listing the properties of the object in JavaScript.

How to Loop through an Array in JavaScript

The most common ways to loop through an array in JavaScript are the for, for/in and while loops. See how to use them. Examples.

How to Loop Through Array and Remove Items Without Breaking the For Loop

Read this JavaScript tutorial and learn some useful information about the method of looping through an Array and removing items without breaking for loop.

How to Loop Through or Enumerate a JavaScript Object

Read this tutorial and learn several useful methods of looping through or enumerate a JavaScript object. Try and copy the piece of the code right away.

How to Move an Array Element from One Array Position to Another

In this JavaScript tutorial, you will read and learn information about an easy insert strategy method of moving the array element to another position.

How to Pass an Array in URL Query String with PHP

In this short tutorial, you will find the way of passing an array in URL query string using PHP.

How to Push Both Value and Key into a PHP Array

In this short tutorial, you will find comprehensive solutions on how to push both value and key into a PHP array.

How to Remove an Element from an Array in JavaScript

Read this tutorial and learn what several useful Array methods exist that will help you remove the specified element from an Array in JavaScript easily.

How to Remove Empty Elements from an Array in Javascript

Read this tutorial and learn the method of removing empty elements from an Array. Also, read about removing falsy elements that include an empty string.

How to Remove Spaces From String

Read this JavaScript tutorial and learn several methods that are used to remove spaces from a string. Also, know which is the fastest method to choose.

How to Replace a Character at a Particular Index in JavaScript

In this tutorial, you will read and learn detailed information about methods that are used to replace a character at a particular index in JavaScript.

How to Separate Odd and Even Elements from an Array Without Using a Loop in PHP

Here, we provide a snippet, explaining how to separate odd and even elements from an array without using a loop in PHP. Read on and check out the examples.

How to Show Angularjs Filtered Count

There are two ways to count items in a filtered AngularJs list used in ngRepeat: to get filter count either in template or in controller. See how to do it.

How to Sort a Multidimensional Array by Value

In this short tutorial, you will learn the most efficient ways to easily sort a multidimensional array by value using PHP. Just follow the steps below.