The function stream_get_meta_data returns header as an array like this:
Array
(
[timed_out] =>
[blocked] => 1
[eof] =>
[wrapper_data] => Array
(
[0] => HTTP/1.1 200 OK
I can get the status with $meta['wrapper_data'][0] but how can I fetch the status code from the value which would be HTTP/1.1 200 OK as explode by HTTP/1.1 is bad idea? Is the only way to use regexp to get the code? If absolutely yes, how is the regexp to get a 3-digits number beginning with 1,2,3,4,5 only?
/[12345]\d\d/