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()
替换子字符
相关文档:
<!-- xml格式
<foo xmlns="test">
<bar attr='a'></bar>
<bar attr='b'></bar>
<bar attr='c'></bar>
</foo>
-->
<?php
$dom = new DOMDocument();
if (!$dom->load('attr.xml'))
{
echo "load books.xml failed!<br>";
re ......
在javascript中用法举例
var rule = /^\d+$/;
if(!rule.test(addform.rmb_price.value)) {
alert('rmb_price must be number');
addform.rmb_price.focus();
return false;
}
在php中用法举例
$aa = "/^\d+$/";
if(preg_match($aa, "111")) {
echo "found";
}
在java中用法举例 ......
原帖地址: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 ......
很荣幸上篇文章被版主推荐到首页了,心里算是激动了一把,继续努力学习中吧。本章主要介绍PHP中的变量。主要包括:预定义变量、变量范围、可变变量以及PHP的外部变量等。
一、基础知识
PHP 中一个美元符号后面跟上一个变量名称,即表示一个变量。变量的名称是对大小写敏感的。
变量名与 PHP 中其它的标签一样遵循相同的 ......
delphi 编写的com 对象 用php调用
的
实例
delphi:
function Tmyxml.Get_xml: WideString;
begin
Get_xml:='wo shi a lei!';
end;
function Tmyxml.Get_xmldata: WideString;
var
xmlStr:string;
begin
xmlStr := '<?xml version="1.0" & ......