1
可以說我有兩個數組在php中乘數組的最佳方式是什麼?
<?PHP
$arr1 = array("a","b","c");
$arr2 = array("1","2","3");
function multiply_arrays($arr1,$arr2){
//what is the best way to do that in terms of speed and memory
return $arr3;
}
?>
什麼是乘他們的最好方法是什麼?
結果應符合下列數值數組:
A1 A2 A3 B1 B2 B3 C1 C2 C3
,因爲我不想面對這樣的錯誤此:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 39 bytes)
謝謝
在數學上它被稱爲張量積,但我不記得OP詢問的編程術語。 – 2009-09-16 02:23:50