GroundZeroStudio Posted February 25, 2007 Share Posted February 25, 2007 I have an array named $not_required . I need it so it checks to see if field is not equal to the contents of the array/ This is what I have if ($field != $not_required) But thhat doesnt work Link to comment https://forums.phpfreaks.com/topic/40080-arrays/ Share on other sites More sharing options...
magnetica Posted February 25, 2007 Share Posted February 25, 2007 First can you give us a little bit more code or tell us what the field type is that you are checking Link to comment https://forums.phpfreaks.com/topic/40080-arrays/#findComment-193851 Share on other sites More sharing options...
Jessica Posted February 25, 2007 Share Posted February 25, 2007 Try in_array() Link to comment https://forums.phpfreaks.com/topic/40080-arrays/#findComment-193853 Share on other sites More sharing options...
itsmeArry Posted February 27, 2007 Share Posted February 27, 2007 intead of using if ($field != $not_required) use if ( !in_array( $field, $not_required ) ) Link to comment https://forums.phpfreaks.com/topic/40080-arrays/#findComment-195220 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.