本文整理汇总了PHP中Arrays::multikey方法的典型用法代码示例。如果您正苦于以下问题:PHP Arrays::multikey方法的具体用法?PHP Arrays::multikey怎么用?PHP Arrays::multikey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arrays
的用法示例。
在下文中一共展示了Arrays::multikey方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: code
public function code($code = 200)
{
$messages = Arrays::multikey($this->config['messages']);
if (isset($messages[$code])) {
return $messages[$code];
}
return false;
}
示例2: set
public function set($exp = '')
{
if (!is_string($exp)) {
return Error::set('Error', 'stringParameter', 'exp');
}
$chars = $this->config['setTimeFormatChars'];
$chars = Arrays::multikey($chars);
$setExp = str_ireplace(array_keys($chars), array_values($chars), $exp);
return strftime($setExp);
}
示例3: set
public function set($exp = 'H:i:s')
{
if (!is_string($exp)) {
return Error::set('Error', 'stringParameter', 'exp');
}
$chars = $this->config['setDateFormatChars'];
$chars = Arrays::multikey($chars);
$newClock = str_ireplace(array_keys($chars), array_values($chars), $exp);
return date($newClock);
}
示例4: _regularConverting
private function _regularConverting($pattern, $ex = '', $delimiter)
{
$specialChars = $this->config['specialChars'];
$pattern = str_ireplace(array_keys($specialChars), array_values($specialChars), $pattern);
// Config/Regex.php dosyasından düzenlenmiş karakter
// listeleri alınıyor.
$regexChars = Arrays::multikey($this->config['regexChars']);
$settingChars = Arrays::multikey($this->config['settingChars']);
// --------------------------------------------------------------------------------------------
$pattern = str_ireplace(array_keys($regexChars), array_values($regexChars), $pattern);
if (!empty($ex)) {
$ex = str_ireplace(array_keys($settingChars), array_values($settingChars), $ex);
}
$pattern = $delimiter . trim($pattern, '/') . $delimiter . $ex;
return $pattern;
}
示例5: vectorSize
protected function vectorSize($mode = '', $cipher = '')
{
$mode = strtolower($mode);
$cipher = strtolower($cipher);
$modes = array('cbc' => 16, 'rc2' => 8, 'ecb' => 0);
$modes = Arrays::multikey($modes);
$mode = isset($modes[$mode]) ? $modes[$mode] : 16;
if (!empty($cipher)) {
$mode = isset($modes[$cipher]) ? $modes[$cipher] : $mode;
}
return mb_substr(hash('sha1', Config::get('Encode', 'projectKey')), 0, $mode);
}
示例6: urlWord
public function urlWord($str = '', $splitWord = '-')
{
if (!is_string($str)) {
return Error::set(lang('Error', 'stringParameter', 'str'));
}
if (!is_string($splitWord)) {
$splitWord = "-";
}
$accent = Config::get('ForeignChars', 'accentChars');
$accent = Arrays::multikey($accent);
$badChars = Config::get('Security', 'urlBadChars');
$str = str_replace(array_keys($accent), array_values($accent), $str);
$str = str_replace($badChars, '', $str);
$str = preg_replace("/\\s+/", ' ', $str);
$str = str_replace(" ", '', $str);
$str = str_replace(' ', $splitWord, trim(strtolower($str)));
return $str;
}
示例7: vectorSize
protected function vectorSize($mode = '', $cipher = '')
{
$mode = strtolower($mode);
$cipher = strtolower($cipher);
$modes = array('cbc' => 8, 'cast_256|loki97|rijndael_128|saferplus|serpent|twofish' => 16, 'rijndael_192' => 24, 'rijndael_256' => 32);
$modes = Arrays::multikey($modes);
$mode = isset($modes[$mode]) ? $modes[$mode] : 8;
if (!empty($cipher)) {
$mode = isset($modes[$cipher]) ? $modes[$cipher] : $mode;
}
return mb_substr(hash('sha1', Config::get('Encode', 'projectKey')), 0, $mode);
}
示例8: accent
public function accent($str = '')
{
if (!is_string($str)) {
return Error::set('Error', 'stringParameter', 'str');
}
// Config/ForeignChars.php dosyasından
// kullanılacak karakter listesini al.
$accent = Config::get('ForeignChars', 'accentChars');
$accent = Arrays::multikey($accent);
return str_replace(array_keys($accent), array_values($accent), $str);
}