mysqlnd_ms_match_wild

(PECL mysqlnd_ms >= 1.1.0)

mysqlnd_ms_match_wildFinds whether a table name matches a wildcard pattern or not

说明

mysqlnd_ms_match_wild ( string $table_name , string $wildcard ) : bool

Finds whether a table name matches a wildcard pattern or not.

This function is not of much practical relevance with PECL mysqlnd_ms 1.1.0 because the plugin does not support MySQL replication table filtering yet.

参数

table_name

The table name to check if it is matched by the wildcard.

wildcard

The wildcard pattern to check against the table name. The wildcard pattern supports the same placeholders as MySQL replication filters do.

MySQL replication filters can be configured by using the MySQL Server configuration options --replicate-wild-do-table and --replicate-wild-do-db. Please, consult the MySQL Reference Manual to learn more about this MySQL Server feature.

The supported placeholders are:

  • % - zero or more literals
  • _ - one literal

Placeholders can be escaped using \.

返回值

Returns TRUE table_name is matched by wildcard. Otherwise, returns FALSE

范例

Example #1 mysqlnd_ms_match_wild() example

<?php
var_dump
(mysqlnd_ms_match_wild("schema_name.table_name""schema%"));
var_dump(mysqlnd_ms_match_wild("abc""_"));
var_dump(mysqlnd_ms_match_wild("table1""table_"));
var_dump(mysqlnd_ms_match_wild("asia_customers""%customers"));
var_dump(mysqlnd_ms_match_wild("funny%table","funny\%table"));
var_dump(mysqlnd_ms_match_wild("funnytable""funny%table"));
?>

以上例程会输出:

bool(true)
bool(false)
bool(true)
bool(true)
bool(true)
bool(true)

相关文章
php enchant 函数 whether a dictionary exists or not. using non empty tagphp enchant 函数 check whether a word is correctly spelled or notphp enchant 函数 whether or not word exists in this spelling sessionphp frontbase 函数 get table name of fieldphp frontbase 函数 别名 fbsql table namephp gnupg 函数 returns an array with information about all keys that matches the given patternphp mcve 函数 whether or not to validate the passed identifier on any transaction it is passed tophp mcve 函数 set whether or not to ping upon connect to verify connectionphp mcve 函数 set whether or not to verify the server ssl certificatephp mysqlnd ms 函数 switch to global sharding server for a given tablephp mysqlnd ms 函数 finds whether a table name matches a wildcard pattern or notphp mysqlnd ms 函数 查询给定的 sql 会发送给 master、slave 还是最后使用的 mysql server 执行。php mysqlnd ms 函数 sets the quality of service needed from the clusterphp mysqlnd ms 函数 sets a callback for user defined read/write splittingphp mysqlnd ms 函数 starts a distributed/xa transaction among mysql serversphp mysqlnd ms 函数 commits a distributed/xa transaction among mysql serversphp mysqlnd ms 函数 garbage collects unfinished xa transactions after severe errorsphp paradox 函数 sets the name of a table deprecated php socket 函数 receives data from a socket whether or not it is connection orientedphp sqlite 函数 finds whether or not more rows are available
关注编程学问公众号