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';
array one is $post_liker; array two is $post_liker_profile;
数组一是$ post_liker;数组二是$ post_liker_profile;
i want to echo out sth. as $post[$post_liker][$post_liker_profile];
我想回应一下。 as $ post [$ post_liker] [$ post_liker_profile];
2 个解决方案
#1
0
Do you mean using something like: array_combine?
你的意思是使用像:array_combine?
$post = array_combine($post_liker, $post_liker_profile);
#2
0
$i=0;
$array[$i][$i]=$array_one[$i]."*".$array_two[$i];
try to use like this while storing and you can use split using * again if you need the values back.
在存储时尝试使用这样的方法,如果需要返回值,可以再次使用*。
if your array values contain * use some thing other that is not present.
如果你的数组值包含*使用其他不存在的东西。
#1
0
Do you mean using something like: array_combine?
你的意思是使用像:array_combine?
$post = array_combine($post_liker, $post_liker_profile);
#2
0
$i=0;
$array[$i][$i]=$array_one[$i]."*".$array_two[$i];
try to use like this while storing and you can use split using * again if you need the values back.
在存储时尝试使用这样的方法,如果需要返回值,可以再次使用*。
if your array values contain * use some thing other that is not present.
如果你的数组值包含*使用其他不存在的东西。