我想要 php 中的 sql left join 功能。
$table1 = array(
0 => array("id" => "id1", "common_key" => 1),
1 => array("id" => "id2", "common_key" => 2),
2 => array("id" => "id3", "common_key" => 1)
);
$table2 = array(
0 => array("name" => "name1", "common_key" => 1),
1 => array("name" => "name2", "common_key" => 2)
);
$result = left_join($table1, $table2);
$result 应该等于下面的数组。
array(
0 => array("id" => "id1", "common_key" => 1, "name" => "name1"),
1 => array("id" => "id2", "common_key" => 2, "name" => "name2"),
2 => array("id" => "id3", "common_key" => 1, "name" => "name1")
)
left_join 函数应该是什么?