一些PHP中之前没见到过的知识点收集
2011-11-27 01:53
483 查看
$_SERVER["PHP_SELF"] 表示当前运行的PHP文件名
ini_get Gets
the value of a configuration option php.ini 中的配置值
mb_internal_encoding Set/Get
internal character encoding 有参数则是set, 没有参数是
mb_substr Get
part of string
Performs
a multi-byte safe substr() operation
based on number of characters. Position is counted from the beginning of str.First
character's position is 0. Second character position is 1, and so on.
http_build_queryGenerate
URL-encoded query string PHP 5+可用,
If
You use php <5 You can use this. (It works fine with complex arrays.) (by
Marco K. (Germany)) WP在用这
<?php
if (!function_exists('http_build_query'))
{
function http_build_query($data, $prefix='', $sep='', $key='')
{
$ret = array();
foreach ((array)$data as $k => $v)
{
if (is_int($k)
&& $prefix != null)
{
$k = urlencode($prefix . $k);
}
if ((!empty($key)) || ($key === 0)) $k = $key.'['.urlencode($k).']';
if (is_array($v)
|| is_object($v))
{
array_push($ret, http_build_query($v, '', $sep, $k));
} else {
array_push($ret, $k.'='.urlencode($v));
}
}
if (empty($sep)) $sep = ini_get('arg_separator.output');
return implode($sep, $ret);
}// http_build_query
}//if
?>
<
d6eb
/span>
date_add — Alias
of DateTime::add()
DateTime::add -- date_add — Adds
an amount of days, months, years, hours, minutes and seconds to a DateTime object
call_user_func — Call
a user function given by the first parameter 方法名不确定时用此方法来调用
mixed call_user_func ( callback $function [, mixed $parameter [, mixed $... ]]
)
endSet
the internal pointer of an array to its last element
<?php
$fruits = array('apple', 'banana', 'cranberry');
echo end($fruits); // cranberry
?>
join()
join() 函数是 implode() 函数的别名。
ini_get Gets
the value of a configuration option php.ini 中的配置值
mb_internal_encoding Set/Get
internal character encoding 有参数则是set, 没有参数是
mb_substr Get
part of string
Performs
a multi-byte safe substr() operation
based on number of characters. Position is counted from the beginning of str.First
character's position is 0. Second character position is 1, and so on.
http_build_queryGenerate
URL-encoded query string PHP 5+可用,
If
You use php <5 You can use this. (It works fine with complex arrays.) (by
Marco K. (Germany)) WP在用这
<?php
if (!function_exists('http_build_query'))
{
function http_build_query($data, $prefix='', $sep='', $key='')
{
$ret = array();
foreach ((array)$data as $k => $v)
{
if (is_int($k)
&& $prefix != null)
{
$k = urlencode($prefix . $k);
}
if ((!empty($key)) || ($key === 0)) $k = $key.'['.urlencode($k).']';
if (is_array($v)
|| is_object($v))
{
array_push($ret, http_build_query($v, '', $sep, $k));
} else {
array_push($ret, $k.'='.urlencode($v));
}
}
if (empty($sep)) $sep = ini_get('arg_separator.output');
return implode($sep, $ret);
}// http_build_query
}//if
?>
<
d6eb
/span>
date_add — Alias
of DateTime::add()
DateTime::add -- date_add — Adds
an amount of days, months, years, hours, minutes and seconds to a DateTime object
call_user_func — Call
a user function given by the first parameter 方法名不确定时用此方法来调用
mixed call_user_func ( callback $function [, mixed $parameter [, mixed $... ]]
)
endSet
the internal pointer of an array to its last element
<?php
$fruits = array('apple', 'banana', 'cranberry');
echo end($fruits); // cranberry
?>
join()
join() 函数是 implode() 函数的别名。
相关文章推荐
- 写在学习php之前的一些话
- 网上收集的php的一些代码
- php里面的一些系统变量,常量收集
- 一些Java知识点的收集整理
- cocos2dx 一些知识点收集
- 本周笔记整理(关于php面向对象的一些基层知识点)
- php中关于mysqli和mysql区别的一些知识点分析
- 收集一些有价值的前端知识点
- PHP一些实用的自定义函数收集
- php的一些较复杂的功能函数收集
- PHP中的一些常用函数收集
- 关于PHP文件上传的一些知识点步骤整理
- 在看本文之前,请确保你已掌握了PHP的一些知识以及MYSQL的查询操作基础
- php中关于mysqli和mysql区别的一些知识点分析
- php中关于mysqli和mysql区别的一些知识点分析
- php5.3兼容之前php代码的一些改动
- PHP中最容易忘记的一些知识点总结
- php中关于mysqli和mysql区别的一些知识点整理
- 在看本文之前,请确保你已掌握了PHP的一些知识以及MYSQL的查询(二)
- 收集的一些c++知识点与题目一