how to remove unuseful array items in preg_match_all result?
some of the items in the regex is not useful for me , I don't want them display in my $result array , how can I do it? I remmbered that preg_match can remove not useful "(xxx)" when get the result , but i don't remember how to code it now
<?php
$url='http://www.new_pm.com/fr/lookbook/2.html';
preg_match_all('@([a-z]{2})?(lookbook)/?(\d+)?(\.html)?@',$url,$result);
print_r($result);
/* -------
Array
(
[0] => Array
(
[0] => lookbook/2.html
)
[1] => Array // I don't want $result has this item
(
[0] =>
)
[2] => Array
(
[0] => lookbook
)
[3] => Array
(
[0] => 2
)
[4] => Array // I don't want $result has this item
(
[0] => .html
)
)
------- */
?>