Clean this php code declaring array
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

Hi there,

I have this in a configuration file. Can someone provide me with the correct way of declaring thes and make it tidy

thanks

can you explain what you want exactly?
Houcem B. A. Chlegou 2 months ago
awarded to Zhopon

Crowdsource coding tasks.

1 Solution

Winning solution

Looks like you are looking for this.

if(!isset ($varColor)) {
$varColor = array (
    "Title"=>"",
    "Color"=>"",
    "logo"=>"",
    "style"=>"",
    "page_id"=>""
);
}

if(!isset ($varMenu)) {
$varMenu = array (
    "side"=>"",
    "top"=>"",
    "menu"=>"",
    "menuTop"=>"",
    "bottom"=>"",
    "menuBottom"=>"",
    "menuTop"=>""
);
}

if(!isset ($varStructure)) {
$varStructure = array (
    "icon"=>"",
    "splash"=>"",
    "description"=>"",
    "keywords"=>"",
    "cat"=>"",
    "certificate"=>""
);
}

if(!isset ($varSlideshow)) {
$varSlideshow = array (
    "one"=>"",
    "two"=>"",
    "three"=>"",
    "four"=>"",
    "five"=>""
);
}

if(!isset ($data)) {
$data = array (
    "Title"=>"",
    "Color"=>"",
    "logo"=>"",
    "logo"=>"",
    "page_id"=>""
);
}

Let me know if this is the solution you are looking for.