本文整理汇总了PHP中kArray::trim方法的典型用法代码示例。如果您正苦于以下问题:PHP kArray::trim方法的具体用法?PHP kArray::trim怎么用?PHP kArray::trim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kArray
的用法示例。
在下文中一共展示了kArray::trim方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: categoryIdsToAllSubCategoriesIdsParsed
/**
* Convert the categories to categories ids - not includes the category itself (only sub categories)
*
* @param string $cats Categories full names
* @param string $statuses comma seperated
* @return string Comma seperated fullIds
*/
public static function categoryIdsToAllSubCategoriesIdsParsed($cats)
{
if ($cats === "") {
$cats = array();
} else {
$cats = explode(",", $cats);
}
kArray::trim($cats);
$categoryFullIdsToIds = array();
foreach ($cats as $cat) {
$category = categoryPeer::retrieveByPK($cat);
//all sub categories and not the category itself
if (!$category) {
continue;
}
$categoryFullIdsToIds[] = $category->getFullIds() . '>';
}
return implode(",", $categoryFullIdsToIds);
}
示例2: durationTypesToIndexedStrings
/**
* Convert the duration types to indexed duration type strings
*
* @param string $durationTypeIds
* @return string
*/
public function durationTypesToIndexedStrings($durationTypeIds)
{
if (is_null($durationTypeIds) || $durationTypeIds === "") {
// string "0" is valid here
$durationTypeIds = array();
} else {
$durationTypeIds = explode(",", $durationTypeIds);
}
kArray::trim($durationTypeIds);
$durationTypesStrings = array();
foreach ($durationTypeIds as $durationTypeId) {
$durationTypesStrings[mySearchUtils::ENTRY_DURATION_TYPE_PREFIX . $durationTypeId] = null;
}
return implode(",", array_keys($durationTypesStrings));
}