How to build array of 'bad' values

Posted by JM4 on Stack Overflow See other posts from Stack Overflow or by JM4
Published on 2010-05-20T21:57:07Z Indexed on 2010/05/20 22:00 UTC
Read the original article Hit count: 188

Filed under:
|

I am processing a form and in turn, receiving a response code based on the information submitted. I have a list of approximately 40 response codes (and their meaning) in my hands and am trying to build an 'if' statement that checks against a predefined array and returns a specific value.

Just not sure how to do this

First pass conceptually:

$bads = array (1,2,3,4,5,6)

if ($output['responsecode'] == (any value in $bads) { echo "you suck"; }

© Stack Overflow or respective owner

Related posts about php

Related posts about array