我多維數組檢查數組多維數組包含值或不
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