I have multiple arrays shown below.
<?php
$arrLayout = array(
"section1" => array(
"wXBMCLibrary" => array(
"title" => "XBMC Library",
"display" => ""
),
"wRecentMovies" => array(
"title" => "Recent Movies",
"display" => ""
)
),
"section2" => array(
"wComingEpisodes" => array(
"title" => "Coming Episodes",
"display" => ""
),
"wSearch" => array(
"title" => "Search",
"display" => ""
)
),
);
From looking at the code I can see that wXBMCLibrary comes from within section1. Is there a way to check via php which section each thing comes from? So if I moved wXBMCLibrary to section 2 and reran the code it would show that it is now in section 2. Hope that makes sense.
I want to
if ( $wXBMCLibrary == "false" )
{
unset($arrLayout['section1']['wXBMCLibrary']);
}
This all works perfectly except that wXBMCLibrary could be in section2 because it dynamically moves so the section1 part in the unset function isn’t accurate. I need a way to check which section it is in so that I can replace section1 with a variable defining the current section.
Thanks
1 Answer