- array_intersect_key: documentation ( source)
- print_r: documentation ( source)
- array_flip: documentation ( source)
- array_keys: documentation ( source)
- preg_grep: documentation ( source)
<?php
$array = array(
'/category/arts_and_entertainment' => 'Arts And Entertainment',
'/category/arts_and_entertainment/animation_and_comics' => 'Animation And Comics',
'//twitter.com/share' => 'Tweet',
'/website/mangafox.me' => 'Mangafox.me',
'/website/mangareader.net' => 'Mangareader.net'
);
$vals = array_intersect_key( $array, array_flip( preg_grep( '/^\/website\//', array_keys( $array ) ) ) );
echo "<pre>"; print_r($vals);exit;