Page 1 of 1
Simple - Change to if not (array).
Posted: Thu Jan 04, 2007 8:38 pm
by JAB Creations
I currently have an array that looks for certain conditions. Right now if any of the conditions in the array are met the end part (below) executes. I would like to simply change it to do the opposite. If the condition is met I wish to not initially execute the script (to of course extend it with an else). I hope that makes sense! I've changed a couple things in my snippet (filler and $variable). I figure this should be easy enough though I've been banding my head trying to get this to work for a while now. Thanks for your help!
Code: Select all
if(in_array($_SERVER['filler'],$variable)){}
Posted: Thu Jan 04, 2007 9:18 pm
by Kieran Huggins
Code: Select all
if(!in_array($_SERVER['filler'],$variable)){}
P.S. - your signature is !charming.
Posted: Thu Jan 04, 2007 9:35 pm
by JAB Creations
Thank you very much!
It's !charming to have one's questions questioned all the time. It leads way off topic and in to some sort of political code related debate and since adding that to my signature the folks who have been kind enough to reply have been of great help (such as yourself). I suppose I could rephrase it though.
Posted: Thu Jan 04, 2007 11:24 pm
by aaronhall
When people are 'questioning your question', I'm guessing that they are really questioning the problem from which the question was derived, to help better solve that problem. I don't think anyone is here to antagonize.
Posted: Fri Jan 05, 2007 8:10 am
by Z3RO21
aaronhall wrote:When people are 'questioning your question', I'm guessing that they are really questioning the problem from which the question was derived, to help better solve that problem. I don't think anyone is here to antagonize.
Agree. Sometimes you need to better understand a situation before applying a solution to it.