Do you mean like this
$result = 10;
foreach ( $posts as $post ) {
if ( $a = $b ) ) {
$result += 1;
} else {
$result -= 2;
}
}
echo 'Your result is ' . $result;
This is the best I can do with the provided information
Do you mean like this
$result = 10;
foreach ( $posts as $post ) {
if ( $a = $b ) ) {
$result += 1;
} else {
$result -= 2;
}
}
echo 'Your result is ' . $result;
This is the best I can do with the provided information