All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
WML学习(四):锚和任务_[XML教程]
ASPX文件转HTML_[Asp.Net教程]
ASP.NET中常用的文件上传下载方法_[Asp.Net教程]
写给XML初学者的一些话_[XML教程]
ZendCache使你的站点飞起来_php资料_编程技术
PHP中计算两个日期之间的差_php资料_编程技术
从VS2003(.net1.1)升级到vs2005(.net2.0)全程跟踪记录_[Asp.Net教程]
ASP.NET,2.0移动开发之列表控件_[Asp.Net教程]
ASP.NET状态管理_[Asp.Net教程]
第六篇:ListView控件与DataPager控件详解(1)_[Asp.Net教程]
Reading number is top 10 pictures
The little woman's bright wire3
湖南中医院的养生八图
西方气质的东方美女2
怀春少女-石一伊
The real super beauty13
Discharge accidentally Actresses by the breast4
Summer is most suitable for young people to travel in China3
全身蕾丝丝质美臀
Chinese paper-cut grilles art appreciation3
So beauty, will let you spray blood10
Download software ranking
SP3 for SQL2000
Unix video tutorial18
实战黑客不求人
Unix video tutorial11
WebService在.NET中的实战应用教学视频 → 第1集
株洲本地在线棋牌游戏
Unix video tutorial7
Take off clothes to survival
Visual C++界面编程技术
Boxer Classic video3
delv published in(发表于) 2013/12/29 4:45:52 Edit(编辑)
概率计算,PHP幸运星_php资料_编程技术

概率计算,PHP幸运星_php资料_编程技术

概率计算 PHP幸运星_php资料_编程技术-你的首页-uuhomepage.com

给定一个概率(这里是点数),确定某次事件是否发生.
可以用在根据用户获得的点数,随机产生网站幸运星等方面(注意:这里有个'等'字).
/**
@title:PHP幸运星(lucker)
@version:1.00
@license:BSD
@author:axgle
*/

$bl = lucker(50);//50%的可能性
var_dump($bl);

function lucker($dot) {
$dot = intval($dot);
$dot = max($dot,0);//min dot = 0
$dot = min($dot,100);//max dot = 100

$one = rand(1,100);
$total = range(1,100);
shuffle($total);

$range = array();
for($i=0; $i<$dot; $i++) {
$range[] = $total[$i];
}
return in_array($one,$range);
}
?>





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.