2016-05-06 9 views
-1

動作しません。私のすべてがOKであるように見えているようだが、それは私にエラーのこの種を与える理由を私は知らない。Wordpressの配列が

Parse error: syntax error, unexpected '[' in /home/sites/xyz.com/public_html/wp-content/themes/abc/single-products.php on line 330

私を助けてください======= ======ここ

Parse error: syntax error, unexpected '[' in /home/sites/xyz.com/public_html/wp-content/themes/abc/single-products.php on line 331

は私のコードです:

<?php 
$exclude = ['diffusion','twice-loved','antique-vintage']; 
$tax_slugs = []; 
foreach ($tax as $value) { 
    array_push($tax_slugs, $value->slug); 
} 
$intersect = count(array_intersect($exclude, $tax_slugs)); 
//if($tax[0]->slug != 'diffusion'): 
if($intersect === 0): 
?> 
+1

「$ exclude」は配列であると考えられますか? PHPで配列を作成する方法を読んだことはありますか? – Dan

答えて

関連する問題