Question: I have this simple array and I'd like to know how I can stop the **first 2** segments from showing.

```
if(preg_match_all('/<td[^>]*class="sourceNameCell">(.*?)<\/td>/si', $printable, $matches, PREG_SET_ORDER));{
foreach($matches as $match) {

$data = "$match[1]";

    $array = array();
    preg_match( '/src="([^"]*)"/i', $data, $array ) ;
    print_r("$array[1]") ;
}

```

Any help would be great, Thanks!

Answer: 
Use `array_slice($array, 2, count($array))` or make your regexp skip the first two if possible.

You could also invoke array\_shift() twice on the array. This might be more optimal since it shouldn't need to make a copy of the array.
You could use [`array_splice`](https://www.php.net/manual/en/function.array-splice.php) to remove elements from array.

> 
> array\_splice — Remove a portion of the array and replace it with something else
> 
> 
> 

Elements are removed from original array and returned

```
$input = array("red", "green", "blue", "yellow", "black");
$part = array_splice($input, 1, 2);
var_dump($input);
var_dump($part);

```

[See PHP fiddle](https://ideone.com/StFFta)