1<?php
2$hackers = array ('Alan Kay', 'Peter Norvig', 'Linus Trovalds', 'Larry Page');
3
4print_r($hackers);
5
6// Search
7$pos = array_search('Linus Trovalds', $hackers);
8
9echo 'Linus Trovalds found at: ' . $pos;
10
11// Remove from array
12unset($hackers[$pos]);
13
14print_r($hackers);
1<?php
2$myArray = array ('Alan', 'Peter', 'Linus', 'Larry');
3$pos = array_search('Linus', $myArray);
4echo 'Linus found at: '.$pos;
5// Remove from array
6unset($myArray[$pos]);
7print_r($myArray);
8?>
1$arr = array('a' => 1, 'b' => 2, 'c' => 3);
2unset($arr['b']);
3
4// RESULT: array('a' => 1, 'c' => 3)
5
6$arr = array(1, 2, 3);
7array_splice($arr, 1, 1);
8
9// RESULT: array(0 => 1, 1 => 3)
1// matrix array
2foreach($appsList as $key => $app) {
3 if($app["app_status"] !== "approved") {
4 // remove orange apps
5 unset($appsList[$key]);
6 }
7}