本文整理汇总了PHP中TikiLib::array_flat方法的典型用法代码示例。如果您正苦于以下问题:PHP TikiLib::array_flat方法的具体用法?PHP TikiLib::array_flat怎么用?PHP TikiLib::array_flat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TikiLib
的用法示例。
在下文中一共展示了TikiLib::array_flat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wp_list_findfields
function wp_list_findfields($data)
{
$data = TikiLib::array_flat($data);
// Heuristic based: only lowecase letters, digits and underscore
$fields = array();
foreach ($data as $candidate) {
if (preg_match("/^[a-z0-9_]+$/", $candidate)) {
$fields[] = $candidate;
}
}
return $fields;
}
示例2: findFields
private function findFields($outputData, $templateData)
{
$outputData = TikiLib::array_flat($outputData);
// Heuristic based: only lowercase letters, digits and underscore
$fields = array();
foreach ($outputData as $candidate) {
if (preg_match("/^[a-z0-9_]+\$/", $candidate) || substr($candidate, 0, strlen('tracker_field_')) === 'tracker_field_') {
$fields[] = $candidate;
}
}
preg_match_all('/\\$(result|row|res)\\.([a-z0-9_]+)[\\|\\}\\w]+/', $templateData, $matches);
$fields = array_merge($fields, $matches[2]);
$fields = array_fill_keys(array_unique($fields), null);
return $fields;
}
示例3: findFields
private function findFields($data)
{
$data = TikiLib::array_flat($data);
// Heuristic based: only lowecase letters, digits and underscore
$fields = array();
foreach ($data as $candidate) {
if (preg_match("/^[a-z0-9_]+\$/", $candidate) || substr($candidate, 0, strlen('tracker_field_')) === 'tracker_field_') {
$fields[] = $candidate;
}
}
return $fields;
}