If you are programmer then you dont need introduction of array. In every language array is the most important part.
how to work with multidimensional array in php
Using array we can achieve so many things and array is useful for so many times when we do programming.
In this article I am going to share some method about PHP array.
What is PHP array?
An array in PHP is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other arrays, trees and multidimensional arrays are also possible.
Tutorial for Checking value from array javascript only. I found useful following URL working with Javascript Array.
http://www.javascriptkit.com/jsref/arrays.shtml
Here is my code to check value from array
var MyArrayVar = new Array(1, 2, 3, 4, 5);
testVar = 2;
if(MyArrayVar.indexOf(testVar) >= 0) {
alert("We got testVar in MyArrayVar");
}else{
alert("We did not got testVar in MyArrayVar");
}
As per this condition I am chekcing the What is returned by this MyArrayVar.indexOf(testVar).
You can check this by using “alert(MyArrayVar.indexOf(testVar));” line.
You will get this number value if testVar number or value present in Array.
You that value is not present in Array you will get the -1 result always.