Showing posts with label array. Show all posts
Showing posts with label array. Show all posts

Friday, 26 September 2014

Push method for javascript array

JavaScript Array pop() Method
var actors = ["Rajini", "Kamal", "Ajith", "Vijay"];
actors.push("Surya");
The result of fruits will be:
Rajini,Kamal,Ajith,Vijay,Surya

To remove array Last index value Javascript

JavaScript Array pop() Method
var actors = ["Rajini", "Kamal", "Ajith", "Vijay"];
actors.pop();
The result of fruits will be:
Rajini,Kamal,Ajith

Thursday, 10 April 2014

PHP array merging & combine for associative array


Input array= array("test"=>array("s1"=>array(),"s2"=>array()))

foreach(array_keys($free_tim) as $k=>$v){
               //echo "$v===".count($free_tim[$v])."
"; foreach((array_keys($free_tim[$v])) as $f=>$s){ foreach(($free_tim[$v][$s]) as $g=>$e){ $te[$v][] = $e; } } } Output array = array("test"=>array())