SQLite3::createCollation() - sqlite3数据库类
SQLite3::createCollation()
(PHP 5 >= 5.3.11, PHP 7)
Registers a PHP function for use as an SQL collating function
说明
publicSQLite3::createCollation(string $name,callable $callback): boolRegisters a PHP function or user-defined function for use as a collating function within SQL statements.
参数
$nameName of the SQL collating function to be created or redefined
$callbackThe name of a PHP function or user-defined function to apply as a callback, defining the behavior of the collation. It should accept two values and return as strcmp() does, i.e. it should return -1, 1, or 0 if the first string sorts before, sorts after, or is equal to the second.
This function need to be defined as:collation(mixed $value1, mixed $value2): int
返回值
成功时返回TRUE
,或者在失败时返回FALSE
。
范例
SQLite3::createCollation() example
Register the PHP function strnatcmp() as a collating sequence in the SQLite3 database.
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!