本文整理汇总了PHP中Parse::condition方法的典型用法代码示例。如果您正苦于以下问题:PHP Parse::condition方法的具体用法?PHP Parse::condition怎么用?PHP Parse::condition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse
的用法示例。
在下文中一共展示了Parse::condition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: conditions
/**
* Parses a conditions string
*
* @param string $conditions Conditions to parse
* @return array
*/
public static function conditions($conditions)
{
$conditions = explode(",", $conditions);
$output = array();
foreach ($conditions as $condition) {
$result = Parse::condition($condition);
$output[$result['key']] = $result['value'];
}
return $output;
}
示例2: conditions
/**
* Parses a conditions string
*
* @param string $conditions Conditions to parse
* @return array
*/
public static function conditions($conditions)
{
// start measuring
$hash = Debug::markStart('parsing', 'conditions');
Debug::increment('parses', 'condition_statements');
$replacement = '__TEMP_COMMA_' . substr(md5(time()), 0, 12) . '__';
$conditions = explode(",", str_replace('\\,', $replacement, $conditions));
$output = array();
foreach ($conditions as $condition) {
Debug::increment('parses', 'conditions');
$result = Parse::condition(str_replace($replacement, ',', $condition));
$output[$result['key']] = $result['value'];
}
// end measuring
Debug::markEnd($hash);
return $output;
}