码迷,mamicode.com
首页 > 其他好文 > 详细

幸运码

时间:2016-05-15 19:27:26      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:

随机抽取幸运码

销毁幸运码

更新码库

Array
(
    [0] => 10000017
    [1] => 10000004
    [2] => 10000011
    [3] => 10000025
    [4] => 10000015
    [5] => 10000012
    [6] => 10000009
    [7] => 10000005
    [8] => 10000022
    [9] => 10000019
    [10] => 10000013
    [11] => 10000021
    [12] => 10000020
    [13] => 10000014
    [14] => 10000010
    [15] => 10000007
    [16] => 10000006
    [17] => 10000016
    [18] => 10000001
    [19] => 10000008
    [20] => 10000003
    [21] => 10000023
    [22] => 10000018
)
4
10000015
Array
(
    [0] => 10000017
    [1] => 10000004
    [2] => 10000011
    [3] => 10000025
    [5] => 10000012
    [6] => 10000009
    [7] => 10000005
    [8] => 10000022
    [9] => 10000019
    [10] => 10000013
    [11] => 10000021
    [12] => 10000020
    [13] => 10000014
    [14] => 10000010
    [15] => 10000007
    [16] => 10000006
    [17] => 10000016
    [18] => 10000001
    [19] => 10000008
    [20] => 10000003
    [21] => 10000023
    [22] => 10000018
)
$l_sql = "select Id,LuckNumberCollection,Remark from product_luckynumber  where Id=".$_POST[‘P_Term_id‘]."";
$r_luck = mysql_query($l_sql,$con);
while($row_luck = mysql_fetch_array($r_luck)){
    //echo "<pre>";
    $string =  ($row_luck[‘LuckNumberCollection‘]);
    //echo "</pre>";
}
$array=explode(‘,‘,$string); 

echo "<pre>";
print_r ($array);
echo "</pre>";

$key = (array_rand($array,1));
echo $key;
echo "<br>";
print_r ($array[$key]);
unset($array[$key]); 

echo "<pre>";
print_r ($array);
echo "</pre>";

 

幸运码

标签:

原文地址:http://www.cnblogs.com/hellowzd/p/5495733.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!