Answer the question
In order to leave comments, you need to log in
Skype? Mobile development?
Is Skype a native or hybrid application?
Answer the question
In order to leave comments, you need to log in
Because in the first case, you are assigning the result of the comparison in $new_events $order->get_new_events_count('comments') > 0
(it can be true or false ).
echo true; // выведет "1"
echo false; // выведет "" (пустую строку).
<?php
$new_events = $order->get_new_events_count('comments');
?>
<?php if ($new_events > 0): ?>
<?= $new_events; ?>
<?php endif; ?>
<? if (($new_events = $order->get_new_events_count('comments')) > 0): ?>
<?= $new_events; ?>
<? endif; ?>
if ($foo = $bar)
instead if ($foo == $bar)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question