Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_array_slice_assoc [ WordPress Function ]

wp_array_slice_assoc ( $array, $keys )
Parameters:
  • (array) $array The original array
  • (array) $keys The list of keys
Returns:
  • (array) The array slice
Defined at:



Extract a slice of an array, given a list of keys.

Source


<?php
function wp_array_slice_assoc$array$keys ) {
    
$slice = array();
    foreach ( 
$keys as $key )
        if ( isset( 
$array$key ] ) )
            
$slice$key ] = $array$key ];

    return 
$slice;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics