本文整理匯總了PHP中jsonRPCClient::name_filter方法的典型用法代碼示例。如果您正苦於以下問題:PHP jsonRPCClient::name_filter方法的具體用法?PHP jsonRPCClient::name_filter怎麽用?PHP jsonRPCClient::name_filter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類jsonRPCClient
的用法示例。
在下文中一共展示了jsonRPCClient::name_filter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: jsonRPCClient
ini_set('memory_limit', 200 * 1024 * 1024);
//
$rpc = new jsonRPCClient($jsonConnect);
$getinfo = $rpc->getinfo();
if (!($getinfo_old = get_cache('getinfo'))) {
$getinfo_old = array('blocks' => 0);
}
if ($getinfo['blocks'] == $getinfo_old['blocks']) {
echo 'Still on same block';
exit;
}
echo "New blocks : " . ($getinfo['blocks'] - $getinfo_old['blocks']) . "\n";
showDebug(0);
//
$diff = $getinfo['blocks'] - $getinfo_old['blocks'];
$new_names = $rpc->name_filter("^d/[a-z0-9_-]+\$", $diff);
#echo '<pre>'; print_r($new_names);
if (!count($new_names)) {
echo 'No new name since last scan';
exit;
}
showDebug(1);
// there are new names
echo "New names : " . count($new_names) . "\n";
format_names($new_names, $getinfo['blocks']);
#echo '<pre>'; print_r($new_names);
set_cache('getinfo', $getinfo);
// get list of names block
if (!($names_block = get_cache('names_block'))) {
$names_block = array();
}