PHP If variable is set to

amr1991

New Member
Messages
396
Reaction score
0
Points
0
I am creating my own CMS. I am trying to implement a navigation system that automatically checks if a page is active, meaning that the page is availible to users. To define whether the page is availible, a variable is placed in a file called config.php.

For example,
PHP:
$news = 1;
$downloads = 0;
$forum = 1;
$gallery = 1;
if the variable is set to 1, its active, otherwise, its inactive. I want PHP to count how many of those variables are active, then use it in a FOR loop to echo the active variables. Any help would be appreciated.
 
Last edited by a moderator:

amr1991

New Member
Messages
396
Reaction score
0
Points
0
the count function with an array worked fine, thanks for the help! :)
 
Top