請任何人都可以解決我的問題。它在drupal 7的意見,我不知道爲什麼if條件不滿意(如果($ mycount == 1))在下面的代碼。Views全局計數器IF條件不起作用?
foreach ($fields as $id => $field){
if($field->class == "counter")
{
$mycount = $field->content;
echo $mycount;
echo "<br>";
}
if($field->class == "field-logo")
{
var_dump($mycount); // output
echo "<br>";
if($mycount == 1) // but here 1 == 1 for the first time. see the output.
{
echo "worked"; // its not coming here...
}
}
}
OUTPUT:
1
string(36) "1"
2
string(36) "2"
3
string(36) "3"
4
string(36) "4"
5
string(36) "5"
感謝。