Mar052012
Mar052012
php explode与split的区别
今天在使用split时遇到一些问题。还是对函数理解不深刻,特写出来做个记号。
首先来看下两个方法的定义:
函数原型:array split (string $pattern, string $string [, int $limit])
函数原型:array explode ( string $separator, string $string [, int $limit])
初看没有啥差别,貌似功能都一样。我就犯了这个错误。 请注意两个函数的第一个参数string $pattern和string sep...阅读全文
Mar052012
Mar042012
css框模型,css box-sizing
box-sizing是CSS3的box属性之一。一说到CSS的盒模型(Box model)我想很多人都会比较烦,特别是对于新手,然而这个Box model又是我们CSS运用中比较重要的一个属性。那么CSS3的Box-sizing跟盒模型有什么关系呢?第一句话就说了,Box-sizing是CSS3的Box属性之一,那他当然也遵循CSS的Box model原理,为了能更好的学习和理解这个Box-sizing属性,我们有必要先了解一下CSS中Box model的原理。
...阅读全文
Mar022012
php exec用法详解
exec函数解析
exec语法: string exec(string command, string [array], int [return_var]);
exec返回值: 字符串
Exec参数说明
Command – 需要执行的命令
Array – 是输出值
return_var –是返回值0或1,如果返回0则执行成功,返回1则执行失败。
exec不成功,调试方案
一个技巧就是使用管道命令, 使用 2>&1, 命令就会输出shell执行时的错误到$output变量, 输出该变量即可分析...阅读全文
Mar022012
Openoffice invalid officehome 解决方案
环境:
Centos5 openoffice3.1.1(beta) jodconverter
报错信息:
Exception in thread "main" java.lang.IllegalStateException: invalid officeHome: it doesn't contain soffice.bin: /opt/openoffice.org3
[root@CentosRD ~]# ln -s /usr/lib/openoffice.org3/program /opt/openoffice.org3
再次执行下面语句
[root@CentosRD ~]# java -jar jodconve...阅读全文
Mar022012
Openoffice xhost 错误解决方案
环境:
Centos 5.0
错误如下:
/soffice.bin X11 error: Can't open display:
Set DISPLAY environment variable, use -display option
or check permissions of your X-Server
(See "man X" resp. "man xhost" for details)
解决方案:
linux下的操作日志如下:
[root@CentosRD ~]# vncserver
New 'localhost:1 (root)' desktop is loc...阅读全文
Mar022012
Mar022012
mysql添加列,删除列,修改表名,列名,列类型
alter table test rename test1; --修改表名
alter table test add column name varchar(10) not null; --添加表列
alter table test drop column name; --删除表列
alter table test modify address char(10) not null;--修改列类型
alter table test change column address address1 char(40) not null;--修改列名称和类型阅读全文
Mar012012
php下eclipse 用空格替换 tab键
本人用eclipse进行PHP项目开发,根据公司开发规范,要用4个空格替换掉tab键,详细的配置如下:
1. windows=》preferences=》general=》editors=》text editors 勾选 “insert spaces for tabs”
2. windows=》preferences=》phpeclipse=》php=》typing 勾选 “insert spaces for tabs(……)”
至此,配置完毕。
但是因为版本的不同,有些会出现这样的问题:if{ ...阅读全文