PHP自学日记
--------------01-05--------------------
*
* 文件操作
*
---------------------------------------
读取整个文件: readfile(), fpassthru(), file()
读取一个字符: fgetc()
读取任意长度: fread()
查看文件是否存在: file_exists()
确定文件大小: filesize()
删除一个文件: unlink()
在文件中定位: rewind(), fseek(), ftell()
文件锁定: flock()
--------------01-05--------------------
*
* 数组操作
*
---------------------------------------
指定范围数组: range()
数组值赋给变量: list()
返回数组中当前的键/值对并将数组指针向前移动一步: each()
将数组的内部指针指向第一个单元: reset()
数组排序: sort(), asort(), ksort()
数组反向排序: rsort(), arsort(), krsort()
数组自定义排序: usort()
数组随机排序: shuffle()
返回一个单元顺序相反的数组: array_reverse()
数组中随机取出一个或多个单元: array_rand()
播下随机数发生器种子: srand() // 例: srand((float) microtime() * 10000000);
分割字符串: explode()
在数组中浏览: each(), current(), reset(), end(), next(), pos(), prev()
对数组的每一个元素应用任何函数: array_walk()
统计数组元素个数: count(), sizeof(), array_count_values()
数组转换成标量变量: extract()
将回调函数作用到给定数组的单元上: array_map()
--------------01-07--------------------
*
* 字符串格式化
*
---------------------------------------
字符串处理: chop(), ltrim(), trim()
HTML格式化: nl2br()
打印格式化字符串: sprintf(), printf(), vprintf(), vsprintf()
转成大写字符: strtoupper()
转成小写字符: strtolower()
首字符为大写: ucfirst()
每个首字符为大写: ucwords()
格式化字符串以便存储: addslashes(), stripslashes()
分割字符串: explode(), strtok()
连接字符串: implode(), join()
截取子字符串: substr()
字符串排序: strcmp(), strcasecmp(), strnatcmp()
字符串长度: strlen()
字符串中查找字符串: strstr(), strchr(), strrchr(), stristr()
查找子字符串位置: strpos(), strrpos()
替换子字符
相关文档:
最近发现很多网站都有一些圈人头像的功能,后来在网上GG了一下,发现是用OpenCV实现的,我也在内部服务器做了一下测试,如果可以实现,步骤如下:
一 安装
1、安装opencv
官方网站:http://www.opencv.org.cn (中文版)
具体安装方法可以参考官方网站:
http://www.opencv.org.cn/index.php/%E6%BA%90%E7%A0%81%E7% ......
PHP与JS---取整数方法int,celi,floor,round
1.丢弃小数部分,保留整数部分
php: intval(7/2)
js:parseInt(7/2)
2.向上取整,有小数就整数部分加1
php: ceil(7/2)
js: Math.ceil(7/2)
3,四舍五入.
php: round(7/2)
js: Math.round(7/2)
4,向下取整
php: floor(7/2)
js: Math.floor(7/2)
以上转自:http://hi.baidu ......
在网站需要建立共享接口的时候,可以使用soap。 下面介绍下在PHP中如何使用SOAP的完整过程。
1、确认PHP环境是否支持soap,检查php配置文件,把extension=php_soap.dll前的分号(;)去掉(windows);若是自己编译则编译时必须加上 --enable-soap选项。
2、建立soap服务端。 下面通过实例来说明如何建立服务端。
<?php
cla ......
原帖地址:http://www.zedwood.com/article/126/php-mail-function-with-attachments
This code sends an html formatted email with attachments. This email sending script actually sends both a plaintext and an html body of the email, allowing the email client to choose which to display. The plaintext emai ......