I have a config file which is included in every part of the website. It looks more or less like this (I removed alot of unnecesary lines for the example):
//Company info
define("COMPANY_NAME", "Test Company");
define("COMPANY_EMAIL", "[email protected]");
define("META_KEYWORDS", "");
define("META_DESCRIPTION", "");
//**********************************************************************
//Remember to change this when working Local or on the Production Server
define("DB_SERVER", "127.0.0.1");
define("DB_USER", "root");
define("DB_PASSWORD", "");
define("DB_SELECTED_DB", "adminpanel");
One of the lines of this config.php file contains this:
$_ITEM_TYPES = array(
1=>"admin",
2=>"page",
3=>"repository"
);
I'm working in a file where this config.php is included, and I can use constants like COMPANY_NAME, COMPANY_EMAIL and so... but when I'm gonna use the $_ITEM_TYPES array, it throws an undefined variable error :/
I've used the function get_included_files() and the file is included indeed! I don't know why I cannot use this array.
PHP File menu.php
include_once("../config.php");
echo COMPANY_NAME;
//Echoes the value correctly
var_dump($_ITEM_TYPES);
//Throws error
Any ideas? Thank you all beforehand.
exit,die,return,unsetetc before the array definition.