On Mon, 11 Aug 2003 10:00:57 +1000 (EST) <[EMAIL PROTECTED]> wrote: > what exactly is action ? > > i usually use a action setup like follows > > ?action=update > > switch ($_GET['action']) { > case 'update': > //do stuff here > break; > case 'insert': > //do stuff here > break; > > } > > very clean
Action is exactly what you imagine and at some point in the scrip I use what you suggest, why I didn't do it here is because I didn't have enough coffee today ;-). Nevertheless the previously suggested solution using in_array() seems cleaner in this case. > > > Here's the problem I have: > > I have $action which can be anyone of a1, a2, a3, a4. > > I tried > > > > if ($action!='a1' || $action!='a3') //tried == also > > { > > //do stuff > > } > > else > > { > > //do other stuff > > } > > > > Problem is that if() only seems to take one option so my construct > > above doesn't work. > > What function can I use to do something like: > > if ($action is among the items of 'a2,a4') kind of construct? > > I tried strpos('a1a2a3',$action) but with the same results. > > TIA > > > > -- > > Regards, Andu Novac > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- Regards, Andu Novac -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php