PHP Code:
<?php

$myarr 
= array(1,0,22,3,85,69,0,11,2,0,0);    //sample array
$t array_reverse($myarr); //reverses the array
foreach($t as $ele)    //loop through the elements in array
{
    if(
$ele 0)    //if the element is greater than 0...
    
{
        echo 
'Last non-zero number = ' $ele//gives 2 as answer
        
break;    // no need to continue the loop since we found an item!
    
}
}

?>