PHP WARLORD
Code
# Code
```php []
class Solution {

    /**
     * @param Integer[] $nums
     * @param Integer $k
     * @return Integer
     */
    function sumOfGoodNumbers($nums, $k) {
        $n = count($nums);
        $res = 0;

        for ($i = 0; $i < $n; $i++) {
            if (0 <= $i - $k && $nums[$i] <= $nums[$i - $k]) {
                continue;
            }
            if ($n > $i + $k && $nums[$i] <= $nums[$i + $k]) {
                continue;
            } 
            $res += $nums[$i];
            
        }
        return $res;
    }
}
```
['PHP']