本文整理汇总了PHP中QuickBooks_Utilities::fnmatch方法的典型用法代码示例。如果您正苦于以下问题:PHP QuickBooks_Utilities::fnmatch方法的具体用法?PHP QuickBooks_Utilities::fnmatch怎么用?PHP QuickBooks_Utilities::fnmatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuickBooks_Utilities
的用法示例。
在下文中一共展示了QuickBooks_Utilities::fnmatch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listActions
/**
* List all of the QuickBooks actions the framework supports
*
* @param string $filter
* @param boolean $return_keys
* @return array
*/
public static function listActions($filter = null, $return_keys = false)
{
$startswith = array('QUICKBOOKS_IMPORT_', 'QUICKBOOKS_QUERY_', 'QUICKBOOKS_ADD_', 'QUICKBOOKS_MOD_', 'QUICKBOOKS_DEL_', 'QUICKBOOKS_VOID_');
$constants = array();
//$inter_key = 'QUICKBOOKS_INTERACTIVE_MODE';
//$inter_val = QUICKBOOKS_INTERACTIVE_MODE;
/*
if (is_null($filter))
{
if ($return_keys)
{
$constants[] = $inter_key;
}
else
{
$constants[] = $inter_val;
}
}
*/
/*
else if ($return_keys and QuickBooks_Utilities::fnmatch($filter, $inter_key))
{
$constants[] = $inter_key;
}
else if (!$return_keys and QuickBooks_Utilities::fnmatch($filter, $inter_val))
{
$constants[] = $inter_val;
}
*/
foreach (get_defined_constants() as $constant => $value) {
foreach ($startswith as $start) {
if (substr($constant, 0, strlen($start)) == $start) {
if (!$return_keys) {
$constant = $value;
}
if (!is_null($filter)) {
if (QuickBooks_Utilities::fnmatch($filter, $constant)) {
$constants[] = $constant;
}
} else {
$constants[] = $constant;
}
}
}
}
sort($constants);
return $constants;
}
示例2: _fnmatch
/**
* Do some fancy string matching
*
* @param string $pattern
* @param string $str
* @return boolean
*/
protected function _fnmatch($pattern, $str)
{
return QuickBooks_Utilities::fnmatch($pattern, $str);
}