2017-08-10 116 views
0

陣列我做了我的Prestashop店的更新,現在我有這樣的錯誤,當我嘗試打開該網站警告:in_array()預計參數2是在PHP

警告:in_array()預計參數2是數組,字符串中 cdesigner.php給出上線431

line 430: $str_low = Tools::strtolower($tags_c); 
line 431: if(!empty($str_low) && !in_array($str_low, $tab_tags_image)) 
line 432: $tab_tags_image[] = $str_low; 
+1

是什麼'tab_tags_image'看起來像$代替$ tab_tags_image?你嘗試過調試嗎?你能否請你更新你的問題,以便在[**最小,完整和可驗證的示例**](http://stackoverflow.com/help/mcve)中顯示**相關代碼**? –

+1

[in \ _array()期望參數2可能重複爲數組,字符串中給出的字符串](https://stackoverflow.com/questions/23437671/in-array-expects-parameter-2-to-be-array給我在classipress) –

+0

我想你shoyld首先定義tab_tags_image爲數組 –

回答

0

你必須使用第二個參數作爲數組不是字符串,所以$ tab_tags_image應該是一個數組。你需要調試使用var_dump($ tab_tags_image); exit;知道哪種類型的價值來。

+0

謝謝你的幫助,我試着調試使用你的提示,但我的網站崩潰了。 現在我有: JSMin:未終止的字符串在字節202:「2 \」,\「3 \」,\「19 \」,\「782 \」]]], 警告:in_array()期望參數2字符串中給出的字符串,在/home/coeurtech/public_html/modules/cdesigner/cdesigner.php 431行 JSMin:字節209處未終止的字符串:「2 \」,\「3 \」,\「19 \」, \「782 \」]]],JSMin:字節991處未終止的字符串:「2 \」,\「3 \」,\「19 \」,\「782 \」]]] – crisjavas

0

試着和array($tab_tags_image)

相關問題