我多维数组检查数组多维数组包含值或不
Array (
[0] => Array (
[questionID] => 47
[surveyID] => 51
[userID] => 31
[question_Title] => Choose Any One?
[question_Type] => Dropdown
[response] => 1.Android 2.Windows 3.Blackberry
[required] => 0
[add_time] => 0
)
[1] => Array (
[questionID] => 48
[surveyID] => 51
[userID] => 31
[question_Title] => Is it?
[question_Type] => Bigbox
[response] => Yes No
[required] => 1
[add_time] => 0
)
)
然后使用foreach循环我提交的每个值,将其插入MySQL数据库 但如果数组存在[required] => 1
我不想提交的任何值
所以,如何检查天气整个阵列conatins [需要] => 1
你尝试过这么远吗?你是否搜索了这个问题?请参阅http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search?lq=1 – 2014-09-23 10:50:45
谢谢@i惊慌的外星人 – 2014-09-23 10:52:20
[检查联合数组包含值](http:// stackoverflow。 com/questions/25988258/check-associative-array-contains-value) – DaSourcerer 2014-09-25 07:22:56