Count and rows code

What is the explanation or meaning of this code:


$totalarr = count($opname) - 1;

and


$totalrows = mysql_num_rows($result);
        $trows = $totalrows - 1;

Thank you

If $opname is an array containing:
[‘this’, ‘that’, ‘other’]

$opname[0] is ‘this’
$opname[1] is ‘that’
$opname[2] is ‘other’

The count for the array is 3, as there are three items in the array.
Your code sample is setting $totalarr to the last index number of the array.

With the mysql_num_rows code, similar behaviour is occurring there too.