1. 定义变量名和函数名或关键字重名: typeerror 在网上随便copy了一个处理csv文件的源码,运行中总是在input时出错,差错没注意变量声明,导致浪费不少时间在红色剪头处,input的输出用input变量名存放,当再次调用input函数时,就会提示:TypeError: str obj...
分类:
编程语言 时间:
2014-06-27 21:40:21
阅读次数:
353
\n 回车 \r 换行 \t 回车1.定义: 双引号定义的:a、可以在双引号里面执行变量,例如: $num = 1000; $str = "it is my $num life "; echo $str; 此时就会输出 it...
分类:
其他好文 时间:
2014-06-27 21:26:25
阅读次数:
293
DateTime dt = DateTime.Now;//2010年10月4日 17点05分 string str = ""; //str = string.Format("{0:y yy yyy yyyy}", dt); //10 10 2010 20...
分类:
其他好文 时间:
2014-06-27 21:18:51
阅读次数:
207
'; echo $str, ''; echo 'A::CONST_NAME->', A::CONST_NAME, ''; echo 'B::CONST_NAME->', B::CONST_NAME, ''; echo 'A::$static_name->', A::$stat...
分类:
Web程序 时间:
2014-06-27 20:54:19
阅读次数:
281
如果函数的参数是一个指针,不要指望用该指针去申请动态内存。示例7-4-1中,Test函数的语句GetMemory(str, 200)并没有使str获得期望的内存,str依旧是NULL,为什么?voidGetMemory(char*p,intnum){p=(char*)malloc(sizeof(.....
分类:
其他好文 时间:
2014-06-26 22:11:55
阅读次数:
301
1.iconv("gb2312","utf-8//IGNORE",$str),转码,这样转码后显示的汉字是uicode码,下面将unicode转为中文2.$array = array( 'test'=>urlencode("我是测试") ); $array =json_encode($array);...
分类:
Web程序 时间:
2014-06-25 17:41:09
阅读次数:
166
#include#includeint main(void){ char str[100]; char des[100]; printf("input a string:"); gets(str); int i = 0; int j = 0; int bla...
分类:
其他好文 时间:
2014-06-25 17:36:11
阅读次数:
163
Write a function to find the longest common prefix string amongst an array of strings.public class Solution { public String longestCommonPrefix(Str...
分类:
其他好文 时间:
2014-06-25 17:03:03
阅读次数:
331
siluke123输出:这样一来我的字输出:这样string mb_strcut ( string $str , int $start [, int $length [, string $encoding ] )mb_strcut() 和 mb_substr() 类似,都是从一个字符串中提取子字符串...
分类:
其他好文 时间:
2014-06-25 12:37:48
阅读次数:
186
获取table中选中一行的一个单元格的值varid=$(‘input:checked‘).val();
alert($(‘input:checked‘).parent().parent().index());
varrow=$(‘input:checked‘).parent().parent().index();
varstr=document.getElementById("table1").rows[row+1].cells[5].innerText;
alert(str);..
分类:
Web程序 时间:
2014-06-25 06:21:50
阅读次数:
281