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

Reading number is top 10 articles
ASP.NET,2.0,绑定高级技巧_[Asp.Net教程]
asp.net中DataList属性、方法和事件
Vista安装.NET,2.0开发环境注意事项_[Asp.Net教程]
MFC应用程序的开发流程
C#教程: 注册表的结构
在ASP.NET,2.0中使用RDLC格式的报表的问题_.net资料_编程技术
用PHP控制用户的浏览器_[PHP教程]
如何利用.NET,Framework使用RSS,feed_[Asp.Net教程]
Delphi执行sql server区间查询
SQL,Server,7.0,入门(三)_mssql学习_编程技术
Reading number is top 10 pictures
From China fortress sora aoi1
The real super beauty2
这才叫绝色美女2
西班牙山村小景3
Absolutely shocked. National geographic 50 animal photographys9
看看什么叫美景
The wise woman of chest2
Female model behind the bitterness, often being overcharged4
A man's favorite things12
美女和狗狗2
Download software ranking
Tram sex maniac 2 (H) rar bag3
Boxer vs Yellow3
Tram sex maniac 2 (H) rar bag5
双旗镇刀客A
The hero
Ashlynn Video3
I'm come from Beijing1
SP3 for SQL2000
Unix video tutorial20
ASP.NET.2.0.XML.高级编程(第3版)
归海一刀 published in(发表于) 2014/2/17 7:25:23 Edit(编辑)
PHP入门需要掌握的几种功能代码_[PHP教程]

PHP入门需要掌握的几种功能代码_[PHP教程]

PHP入门需要掌握的几种功能代码_[PHP教程]

经典循环例子


经典循环例子


for($counter = 1; $counter <= 6; $counter++) //循环6次
{
print("counter is $counter
\n"); //打印6次
}
?>



for的高级运用


for的高级运用


/*
** 打印必要的说明文字
*/
print("距离星期一还有几天?\n");
print("

    \n");
    for($currentDate = date("U"); //定义$currentDate时间格式
    date("l", $currentDate) != "Monday"; //判断是不是当前系统时间是Monday
    $currentDate += (60 * 60 * 24)) //当前时间加上1天
    {
    /*
    ** 打印时间名称
    */
    print("
  1. " . date("l", $currentDate) . "\n");
    }
    print("
\n");
?>



函数的简单调用:


简单的函数



function printBold($inputText) //定义function printBold()
{
print("" . $inputText . ""); ////打印$inputText
}
print("这行没有加重!
\n"); //直接打印字符串
printBold("这行加重了!!!"); //调用function printBold()函数
print("
\n");
print("这行没有加重!
\n"); //直接打印字符串
?>




有返回值的函数


有返回值的函数



function makeBold($inputText) //定义function makeBold()函数
{
$boldedText = "";
$boldedText .= $inputText;
$boldedText .= "
";
return($boldedText); //返回变量$boldedText
}
print("这行没有加重!!!
\n"); //直接打印字符串
print(makeBold("这行被加重了!!!") . "
\n");//调用function makeBold()函数
print("这行没有加重!!!
\n"); //直接打印字符串
?>




有默认参数的函数


有默认参数的函数



function printColored($Text, $Color="black") //定义function函数
{
print("$Text"); //获取字符串的内容和颜色
}
printColored("这是黑颜色的字!"); //调用function函数
print("

\n");
printColored("这是蓝颜色的字!", "blue"); //调用function函数
print("
\n");
?>




用递规算法判断是否是整数


判断整数


function checkInteger($Number)
{
if($Number > 1)
{
/* 整数减1仍然是整数 */
return(checkInteger($Number-1));
}
elseif($Number < 0)
{
/* 对于一个负数,*/
/* 可以分析它的绝对值*/
return(checkInteger((-1)*$Number-1));//取绝对值,把负数按整数分析
}
else
{
if(($Number > 0) AND ($Number < 1))
{
return("当然不是");
}
else
{
/* 0 和 1 是整数 */
/* 根据相关数学定义 */
return("是的");
}
}
}
print("0是整数吗?" .
checkInteger(0) . "
\n");
print("7是整数吗? " .
checkInteger(7) . "
\n");
print("3.5呢?" . checkInteger(3.5) . "
\n");
print("那么-5呢?" . checkInteger(-5) . "
\n");
print("还有-9.2?" . checkInteger(-9.2) . "
\n");
?>




添加到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.