Reputation: 39
I have a file called layout.php which contains
<?php
$arrLayout = array(
"section1" => array(
"wXBMCLibrary" => array(
"title" => "XBMC Library",
"display" => ""
),
"wRecentMovies" => array(
"title" => "Recent Movies",
"display" => ""
),
"wRecentTV" => array(
"title" => "Recent TV",
"display" => ""
)
)
);
?>
What I would like to be able to do is remove any part, for example if I say remove wXBMCLibrary it must remove all of the below
"wXBMCLibrary" => array(
"title" => "XBMC Library",
"display" => ""
),
Is this at all possible? Would you be able to unset the whole piece? What would the coding be? Regards
Upvotes: 1
Views: 70
Reputation: 8767
This is completely possible through the usage of unset()
within PHP. The unset()
function will remove the item that you specify, so if you specify unset($arrLayout['section1']['wXBMCLibrary']);
then that will remove the array with the index of 'wXBMCLibrary'.
Upvotes: 0