예제 #1
0
 function printarr($arr)
 {
     foreach ($arr as $k => $v) {
         if (is_array($v)) {
             printarr($v);
         } else {
             echo "<tr>\n\t<td>&laquo;{$k}&raquo;</td>\n\t<td>&laquo;" . htmlspecialchars($v, ENT_COMPAT, 'UTF-8') . "&raquo;</td>\n</tr>\n";
         }
     }
 }
예제 #2
0
/**
*	prf
*
*	Print $_FILES array
*	
*	@return	void
**/
function prf()
{
    printarr($_FILES, '$_FILES:');
}
예제 #3
0
        echo "<br>";
        echo "k: ";
        for ($k = 0; $k < $i; $k++) {
            echo '[' . $k . ']';
            if ($arr[$k + 1] < $arr[$k]) {
                $tmp = $arr[$k + 1];
                $arr[$k + 1] = $arr[$k];
                $arr[$k] = $tmp;
            }
        }
        echo "<br>";
        print_r($arr);
        echo "<hr>";
    }
    return $arr;
}
$arr = array(255, 1, 22, 3, 45, 5, 6);
// print_r($arr);
printarr($arr);
$result = netbubbleSort($arr);
$myresult = mybubbleSort($arr);
// print_r($result);
printarr($result);
printarr($myresult);
function printarr($a)
{
    foreach ($a as $key => $value) {
        echo $value . "<br>";
    }
    echo "<hr>";
}