如何将两个长度相同的数组组合成一个二维数组


how to combine two arrays with the same length into a two dimensional array

include 'core/init.php'; 
include 'includes/overall/header.php';
$post_id = $_GET['post_id'];
$check_like = mysql_query("SELECT liker, liker_username FROM `likes` WHERE `post_id`='$post_id' ");
                while($run_check_like = mysql_fetch_assoc($check_like)) {
                $post_liker[] = $run_check_like['liker'];
                $post_liker_profile[] = $run_check_like['liker_username'];           
        }   
include 'includes/overall/footer.php';

数组 1 是 $post_liker;数组 2 是 $post_liker_profile;

我想呼应 sth. 作为$post[$post_liker][$post_liker_profile];

你的意思是使用这样的东西:array_combine?

$post = array_combine($post_liker, $post_liker_profile);

$i=0;

$array[$i][$i]=$array_one[$i]."*".$array_二[$i];

尝试在存储时像这样使用,如果您需要返回值,您可以再次使用 * 进行拆分。

如果您的数组值包含 * 使用其他不存在的内容。