本文整理匯總了PHP中StringUtils::starts_with方法的典型用法代碼示例。如果您正苦於以下問題:PHP StringUtils::starts_with方法的具體用法?PHP StringUtils::starts_with怎麽用?PHP StringUtils::starts_with使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類StringUtils
的用法示例。
在下文中一共展示了StringUtils::starts_with方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __is_notset_key
private static function __is_notset_key($key)
{
if (StringUtils::starts_with($key, self::NOTSET_KEY_PREFIX)) {
return true;
} else {
return false;
}
}
示例2: clear
static function clear()
{
$t = self::internalInit();
$root_elements = $t->get("/");
foreach ($root_elements as $k => $v) {
if (!StringUtils::starts_with($k, "__")) {
$t->remove($k);
}
}
}
示例3: setupByParams
public function setupByParams($do)
{
$fields = $this->__getAllFields();
$pk_fields = $this->__getPrimaryKeyFields();
$params_list = array();
//tolgo le chiavi primarie
foreach (ArrayUtils::delete_keys($fields, $pk_fields) as $fkey => $attribs) {
if (Params::is_set($fkey)) {
$params_list[$fkey] = Params::get($fkey);
}
}
foreach (Params::keys() as $k) {
if (StringUtils::starts_with($k, self::CHECK_PREFIX)) {
$field_to_check = substr($k, strlen(self::CHECK_PREFIX));
if (Params::is_set($field_to_check)) {
$params_list[$field_to_check] = true;
} else {
$params_list[$field_to_check] = false;
}
}
}
return $this->setupWithMap($do, $params_list);
}
示例4: isParentOf
function isParentOf($folder)
{
if ($folder instanceof Dir) {
$d = $folder;
} else {
$d = new Dir($folder);
}
$path_a = $this->getPath();
$path_b = $d->getPath();
return StringUtils::starts_with($path_b, $path_a);
}