how i make mean and mod function in php and fill the null places : **bellow is my arrry** i want to find **mean and mod** 
if the value is numeric then mean function run and found mean and put the result in nul space 
and as well as if the value is string type then find the mod(most repeated value) and put this value in null space...
please tell how i do that in php 


**how i make two function for find mean and mod and how i judge the value are numeric and string then apply function and fill the blank spaces** 



Array 
    [1] => Array
        (
            [1] => 4
            [2] => 2
            [3] => 3
            [4] => 
            
      
        )

    [2] => Array
        (
            [1] => one
            [2] => two
            [3] => two
            [4] => 
           
        )
		
		
    [3] => Array
        (
            [1] => 8
            [2] => 
            [3] => 8
            [4] => 5
           
        )
}

please help me 