I am using below php functions to get highest and lowest integer value from my array.
min($output[$k]) AND max($output[$k])
Problem:
I want to get maximum and minimum integer values from that array excluding ZEROs and NULL values
Use array_diff() to filter array:
<?php
header('Content-Type: text/plain');
$buffer = array(null, 0, 1, 2, 3, 0, null, 1);
$filtered = array_diff($buffer, array(null, 0));
$max = max($filtered);
$min = min($filtered);
var_dump($max, $min);
?>
Shows:
int(3)
int(1)