Finding Array length incakephp


In my cakePHP controller there is an action named saveReport() where $attribute_ids is an array holding all the selected attributes obtained from the Ajax post..

function saveReport()
    echo $this->params['form']['formid'];
    echo $this->params['form']['reportTitle'];
    echo $this->params['form']['attr'];
    $comma_separated = explode(",", $attribute_ids);

        echo $comma_separated[$i]; 
        echo "     ";


how to identify $comma_separated 's length where $comma_separated is an array so that i can use that in the for loop now i have used as 15 by default...