<?php

    function insertionSort(array $array, $value) {
        $length=count($array);
        for ($i=0;$i<$length;$i++) {
            
            if($array[$i] == $value){
              echo $i . " " . $value;
        }
    }
    
}
    
insertionSort([31,
41,
59,
2,
6,
41,
58], 59);