JSP/PHP运用详解
1,DateTime类型数字
以下是引用片段:
当前时间System.DateTime的=新System.DateTime的();
1.1小时分钟当前日期秒,当前时间= System.DateTime.Now;
1.2检查本年度廉政年= currentTime.Year;
1.3当前月份廉政个月= currentTime.Month;
1,4采取当天廉政天= currentTime.Day;
1.5获取当前时间廉政时间= currentTime.Hour;
1.6检查当前的分源情报站= currentTime.Minute;
以目前的1.7秒廉政秒= currentTime.Second;
以目前1.8毫秒廉政毫秒= currentTime.Millisecond;
(变量可用中文)
2,Int32.Parse(变量),Int32.Parse(“常量”)
以下是引用片段:
转换为32位字符字体
3个变量。的toString()
以下是引用片段:
符号转换为一个字符串
12345.ToString(“n”型); / /生成12,345.00
12345.ToString(“C”类); / /生成¥12,345.00
12345.ToString(“电子”); / /生成1.234500e 004
12345.ToString(“F4”类); / /生成12,345.0000
12345.ToString(“×”); / /生成3039(16进制)
12345.ToString(“p”表示); / /生成1,234,500.00%
4,变量。长度数值
以下是引用片段:
获取字符串长度:
如:字符串str =“中国”;
廉政长度= str.length; / / len是一个自定义变量str是实现可衡量的变量名称字符串
5,System.Text.Encoding.Default.GetBytes(变量)
以下是引用片段:
位码字码开关
例如:字节[] bytStr = System.Text.Encoding.Default.GetBytes(海峡);
其次是位长:
长度= bytStr.Length;
6,System.Text.StringBuilder(“”)
以下是引用片段:
字符串添加(+数字是不一样的事?)
由于System.Text.StringBuilder某人=新System.Text.StringBuilder ("");
sb.Append(“中华人民共和国”);
sb.Append(“公共”);
sb.Append(“共和国”);
7,变量。串(参数1,参数2);
以下是引用片段:
拦截的左原来的参数字符串的一部分右翼的数字,少数拦截参数2。
例如�
相关文档:
可以通过序列话一个数组,然后放到cookie中
从cookie中得到值,然后在反序列化,转换为数组。
$cur_goods_array = unserialize(stripslashes($_COOKIE['shop_cart_info']));
setcookie("shop_cart_info",serialize($cur_goods_array)); ......
1.冒泡排序
function m_sort($arr)
{
$l = count($arr);
if($l==0) return false;
for($i=0;$i
{
for($j=$i+1;$j
......
Show All 1 2 3 4 5
本文由Michael原创和整理,转载请保留出处!http://www.toplee.com/blog/?p=100
Trackback URL: http://www.toplee.com/blog/wp-trackback.php?p=100
对于本文中出现的错误导致您的损失,Michael不承担责任。
前一段时间完成了服务器从FreeBSD4.10到6.1的升级,同时把PHP也升级到了最新的 ......
火车头官方提供的discuz6.1的php接口比较粗糙,基本不能满足需要,本人在采集的工作中使用的采集接口文件如下:
PS:对原文件的修改较大,程序中注释已经很详尽,这里就不多说了。
// header('Content-Type:text/html;charset=UTF-8');
//if(function_exists("mb_convert_encoding")){ ......
/* 字体转换
$content 内容
$to_encoding 目标编码,默认为UTF-8
$from_encoding 源编码,默认为GBK
*/
function mbStrreplace($content,$to_encoding="UTF-8",$from_encoding="GBK") {
$content=mb_convert_encoding($content,$to_encoding,$from_encodin ......