爱玺玺

爱玺玺的生活日记本。wx:lb87626

php合并数组array_merge()

<?php

session_start();

include_once("../libs/variable.php");



$idsql = "select distinct if(retid=0,ifnull(fwtid,tid),retid) from talk_rec where (content!='' or imgs!='' or video!='') and   uid = '$uid' and retid =0 and fwtid is NULL order by pubtime desc limit 0,20";

$sql1=$db->getcol($idsql);

print_r($sql1);

echo "<hr>";

$idsq2 = "select distinct ifnull(fwtid,retid) from talk_rec where uid = '$uid' and fwtid>0 order by pubtime desc limit 0,20";

$sql2=$db->getcol($idsq2);

print_r($sql2);

echo "<hr>";

print_r(array_merge_recursive($sql1,$sql2));


echo "<hr>";

$a1=array("a"=>"red","b"=>"green");

$a2=array("c"=>"blue","b"=>"yellow");

print_r($a1);

echo "<hr>";

print_r($a2);

echo "<hr>";

print_r(array_merge_recursive($a1,$a2));

?>


发表评论:

Powered By Z-BlogPHP 1.4 Deeplue Build 150101

Copyright Your WebSite.Some Rights Reserved.

蜀ICP备11021721号-5