PHP - Manual手册 - CLXVII. Tokenizer Functions解析器代号函数 - token_get_all把给定源代码分解成解析器代号
token_get_all
(PHP 4 >= 4.2.0, PHP 5)
token_get_all — Split given source into PHP tokens
说明 array
token_get_all ( string $source )
token_get_all() parses the given source string into PHP language tokens using the Zend engine's lexical scanner.
For a list of parser tokens, see 附录 R, 解析器代号列表, or use token_name() to translate a token value into its string representation.
参数
source
The PHP source to parse.
返回值
An array of token identifiers. Each individual token identifier is either a single character (i.e.: ;, ., >, !, etc...), or a two element array containing the token index in element 0, and the string content of the original token in element 1.
范例
例 2356. token_get_all() examples
$tokens=token_get_all('<?php echo; ?>');/* => array(
array(T_OPEN_TAG, '<?php '),
array(T_ECHO, 'echo'),
';',
array(T_CLOSE_TAG, '?>') ); */
/* Note in the following example that the string is parsed as T_INLINE_HTML
rather than the otherwise expected T_COMMENT (T_ML_COMMENT in PHP <5).
This is because no open/close tags were used in the "code" provided.
This would be equivalent to putting a comment outside of <?php ?> tags in a normal file. */
$tokens=token_get_all('/* comment */');// => array(array(T_INLINE_HTML, '/* comment */'));
?>
[token_get_all把给定源代码分解成解析器代号 - 文档]
[PHP - 关键词] php
[PHP - 相关论坛]
http://php.board.newsmth.net/
http://bbs.pku.edu.cn/, homepage看版
http://forum.csdn.net/SList/PHP/
[PHP - 下载]
AppServ 2.5.9, http://www.appservnetwork.com/
[PHP - Manual手册]
foreach遍历数组, http://www.php.net/manual/zh/control-structures.foreach.php
[PHP - Manual手册 - 下载]
http://www.php.net/download-docs.php
[PHP - Manual手册 - 第 12 章 变量]
[PHP - Manual手册 - 第 15 章 运算符]
[PHP - Manual手册 - 第19章 类与对象(PHP 5)]
Object cloning对象克隆, http://www.php.net/manual/zh/language.oop5.cloning.php
[PHP - Manual手册 - 第20章 异常处理]
用异常处理php改进流程
[PHP - Manual手册 - 第21章 引用的解释]
[PHP - Manual手册 - 第 43 章 PHP 的命令行模式]
[PHP - Manual手册 - V. Array 数组函数]
计算数组的交集, http://www.php.net/manual/zh/function.array-intersect.php
[PHP - Manual手册 - XVIII. CURL, 客户端URL库函数]
[PHP - Manual手册 - XXII. Date/Time 日期/时间函数]
date格式化一个本地时间/日期, http://www.php.net/manual/zh/function.date.php
[PHP - Manual手册 - XXXIII. Error Handling and Logging Functions错误处理和日志函数]
概述, http://www.php.net/manual/zh/ref.errorfunc.php
[PHP - Manual手册 - XLVII. Function Handling Functions函数管理函数]
[PHP - Manual手册 - XC. Miscellaneous Functions杂项函数]
[PHP - Manual手册 - XCVIII. MySQL 函数]
[PHP - Manual手册 - CII. Network Functions网络函数]
[PHP - Manual手册 - CXXVII. PostgreSQL 数据库函数]
pg_insert将数组插入到表中, http://www.php.net/manual/zh/index.php
[PHP - Manual手册 - CXXX. Program Execution Functions程序调用函数]
[PHP - Manual手册 - CXLIX. Session 会话处理函数]
session.save_path 定义了传递给存储处理器的参数, http://www.php.net/manual/zh/ref.session.php#ini.session.save-path
[PHP - Manual手册 - CLXI. String 字符串处理函数]
str_pad使用另一个字符串将一个字符串填充到指定长度, http://www.php.net/manual/zh/function.str-pad.php
[PHP - Manual手册 - CLXVI. Tidy Functions - Tidy函数]
概述, http://www.php.net/manual/zh/ref.tidy.php
[PHP - Manual手册 - CLXVII. Tokenizer Functions解析器代号函数]
[PHP - Manual手册 - CLXIX. URL 函数]
概述, http://www.php.net/manual/zh/ref.url.php
[PHP - Manual手册 - 附录 H. php.ini 配置选项]
register_globals 决定是否将 EGPCS(Environment,GET,POST,Cookie,Server)变量注册为全局变量, http://www.php.net/manual/zh/ini.core.php#ini.register-globals
[PHP - Manual手册 - 附录 L. 保留字列表]
[PHP - Manual手册 - 附录 Q. PHP 类型比较表]
[PHP - 应用实例]
语法着色, php.exe -s "%1" > "%1.html"
移除SimpleXML对象中的子对象