Aureole Posted October 9, 2007 Share Posted October 9, 2007 Ok I've hit a dilemma I'm wondering if anyone might be able to help me... Basically here's what I'm trying to do... I want to have an input field in my Admin CP when you are creating a Forum where you can input a list of numbers (member ids) seperated by commars, like this: 1,6,4,8,2 These will be the ids of people who can moderate the Forum and will be stored in the db along with all the other stuff like forum name/description etc. That's easy enough. Now my problem is I need to get that from the db and store it in an array... basically so I can do something like: <?php if(in_array($_SESSION['mem_id'], $forum_moderator_array)) { echo('Congratulations, you are a forum moderator.'); } ?> How can I go about doing this? Quote Link to comment Share on other sites More sharing options...
haaglin Posted October 9, 2007 Share Posted October 9, 2007 I think the function you are looking for is explode: $values = "1,6,4,8,2"; $forum_moderator_array = explode(",",$values); Quote Link to comment Share on other sites More sharing options...
Aureole Posted October 9, 2007 Author Share Posted October 9, 2007 I'll try it out and let you know the result. Quote Link to comment Share on other sites More sharing options...
Aureole Posted October 9, 2007 Author Share Posted October 9, 2007 That worked perfect, thanks a lot. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.