I need to save 'Date' in array to php variable. (get\_headers)
There are 2 types of array.

Type1

```
Array
(
    [0] => HTTP/1.1 302 Object Moved
    [Content-Type] => Array
        (
            [0] => text/html
            [1] => text/html;charset=UTF-8
        )
    [1] => HTTP/1.1 200 OK
    [Date] => Thu, 27 Jun 2013 06:50:37 GMT

```

Type2

```
Array
(
    [0] => HTTP/1.1 301 Moved Permanently
    [Date] => Array
        (
            [0] => Thu, 27 Jun 2013 06:50:27 GMT
            [1] => Thu, 27 Jun 2013 06:41:59 GMT
        )

```

Here is how I slice:

```
$arr = array();
$arr = get_headers($url,1);

$date_variable = $arr[Date];

if($date_variable == 'Array'){
        $date = $arr[Date][0];
}
else {
    $date = $arr[Date];
}

```

My slicing is very ugly.. and $date\_variable == 'Array' doesn't work..