当前位置: 首页>>代码示例>>PHP>>正文


PHP GetType函数代码示例

本文整理汇总了PHP中GetType函数的典型用法代码示例。如果您正苦于以下问题:PHP GetType函数的具体用法?PHP GetType怎么用?PHP GetType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetType函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: printPrefixFilter

 static function printPrefixFilter($query)
 {
     static $loop_already_started;
     if ($loop_already_started) {
         return;
     }
     # If this is feed we bail out
     if (Is_Feed()) {
         return;
     }
     # If the current query is not a post query we bail out
     if (!(GetType($query) == 'object' && Get_Class($query) == 'WP_Query')) {
         return;
     }
     global $wp_current_filter;
     if (In_Array('wp_head', $wp_current_filter)) {
         return;
     }
     # Conditions
     if ($query->Is_Main_Query() && !$query->Get('suppress_filters')) {
         $is_archive_filter = self::isGlossaryArchive($query) && Options::Get('prefix_filter_for_archives');
         $is_singular_filter = $query->Is_Singular(Post_Type::$post_type_name) && Options::Get('prefix_filter_for_singulars');
         # Get the Filter depth
         $filter_depth = False;
         if ($is_archive_filter) {
             $filter_depth = Options::Get('prefix_filter_archive_depth');
         } elseif ($is_singular_filter) {
             $filter_depth = Options::Get('prefix_filter_singular_depth');
         }
         if ($is_archive_filter || $is_singular_filter) {
             Prefix_Filter::printFilter($filter_depth);
             $loop_already_started = True;
         }
     }
 }
开发者ID:andyUA,项目名称:kabmin-new,代码行数:35,代码来源:class.core.php

示例2: GetCompleteValues

 function GetCompleteValues(&$form, $arguments)
 {
     if (!isset($arguments['CompleteValues']) || GetType($complete_values = $arguments['CompleteValues']) != 'array' || count($complete_values) == 0) {
         return 'it were not specified valid complete values';
     }
     $this->complete_values = $complete_values;
     return '';
 }
开发者ID:wycus,项目名称:darmedic,代码行数:8,代码来源:form_auto_complete.php

示例3: cdata

 public function cdata($parser, $data)
 {
     $element = $this->structure[$this->path]['Components'];
     $previous = $this->path . ',' . strval($element - 1);
     if ($element > 0 && GetType($this->structure[$previous]) == 'string') {
         $this->structure[$previous] .= $data;
     } else {
         $this->setelementdata($this->path . ',' . $element, $data);
         $this->structure[$this->path]['Components']++;
     }
     return $this->parser ? $this->doCdata($data) : false;
 }
开发者ID:innomatic,项目名称:innomatic-legacy,代码行数:12,代码来源:XMLParser.php

示例4: DumpStructure

function DumpStructure(&$structure, &$positions, $path)
{
    echo "[" . $positions[$path]["Line"] . "," . $positions[$path]["Column"] . "," . $positions[$path]["Byte"] . "]";
    if (GetType($structure[$path]) == "array") {
        echo "<" . $structure[$path]["Tag"] . ">";
        for ($element = 0; $element < $structure[$path]["Elements"]; $element++) {
            DumpStructure($structure, $positions, $path . ",{$element}");
        }
        echo "&lt;/" . $structure[$path]["Tag"] . "&gt;";
    } else {
        echo $structure[$path];
    }
}
开发者ID:sjw-github,项目名称:lib,代码行数:13,代码来源:test_xml_parser.php

示例5: DecodeText

 function DecodeText($encoded, &$encode_time)
 {
     if (GetType($colon = strpos($encoded, ":")) != "integer" || ($encode_time = intval(substr($encoded, $colon + 1))) == 0 || $encode_time > time() || !($encrypted = base64_decode(substr($encoded, 0, $colon)))) {
         return "";
     }
     $iv_size = mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_CFB);
     $iv = str_repeat(chr(0), $iv_size);
     $key_size = mcrypt_get_key_size(MCRYPT_3DES, MCRYPT_MODE_CFB);
     $key = $encode_time . $this->key;
     if (strlen($key) > $key_size) {
         $key = substr($key, 0, $key_size);
     }
     return mcrypt_cfb(MCRYPT_3DES, $key, $encrypted, MCRYPT_DECRYPT, $iv);
 }
开发者ID:wycus,项目名称:darmedic,代码行数:14,代码来源:form_captcha.php

示例6: Unserialize

 function Unserialize()
 {
     if (isset($this->cookie_value)) {
         return $this->cookie_value;
     }
     if (!isset($_COOKIE[$this->cookie_name]) || strlen($serialized = $this->Decrypt($_COOKIE[$this->cookie_name], $encode_time)) == 0) {
         return null;
     }
     $value = @unserialize($serialized);
     if (GetType($value) != 'array') {
         return null;
     }
     return $this->cookie_value = $value;
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:14,代码来源:cookie_oauth_client.php

示例7: DecryptValidation

 function DecryptValidation($encoded)
 {
     if (GetType($colon = strpos($encoded, ':')) != 'integer' || strlen($encoded) <= $colon + 3 || ($encrypt_time = intval(substr($encoded, $colon + 3))) == 0 || $encrypt_time > time() || !($encrypted = base64_decode(substr($encoded, 0, $colon)))) {
         return '';
     }
     $iv_size = mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_CFB);
     $iv = str_repeat(chr(0), $iv_size);
     $key_size = mcrypt_get_key_size(MCRYPT_3DES, MCRYPT_MODE_CFB);
     $salt = substr($encoded, $colon + 1, 2);
     $key = $salt . $this->key;
     if (strlen($key) > $key_size) {
         $key = substr($key, 0, $key_size);
     }
     return mcrypt_cfb(MCRYPT_3DES, $key, $encrypted, MCRYPT_DECRYPT, $iv);
 }
开发者ID:wycus,项目名称:darmedic,代码行数:15,代码来源:form_secure_submit.php

示例8: AddInput

 function AddInput(&$form, $arguments)
 {
     if (!isset($arguments['OPTIONS']) || GetType($arguments['OPTIONS']) != 'array' || count($this->options = $arguments['OPTIONS']) == 0) {
         return 'it were not specified the list select options';
     }
     if (!isset($arguments['VALUE']) || !isset($this->options[$this->VALUE = $arguments['VALUE']])) {
         return 'it was not specified a valid list select value';
     }
     if (isset($arguments['Columns']) && (GetType($arguments['Columns']) != 'array' || count($this->columns = $arguments['Columns']) == 0)) {
         return 'it was not specified a valid list select columns';
     }
     if (isset($arguments['Rows']) && (GetType($arguments['Rows']) != 'array' || count($this->rows = $arguments['Rows']) == 0)) {
         return 'it was not specified a valid list select columns';
     }
     if (isset($arguments['CLASS'])) {
         $this->CLASS = $arguments['CLASS'];
     }
     if (isset($arguments['STYLE'])) {
         $this->STYLE = $arguments['STYLE'];
     }
     if (isset($arguments['SIZE'])) {
         $this->SIZE = $arguments['SIZE'];
     }
     $this->name = $this->GenerateInputID($form, $this->input, 'radio');
     $to = count($this->options);
     for ($o = 0, Reset($this->options); $o < $to; Next($this->options), ++$o) {
         $option = Key($this->options);
         $a = array('TYPE' => 'radio', 'NAME' => $this->name, 'ID' => $this->name . $option, 'VALUE' => $option);
         if ($o == 0) {
             if (isset($arguments['LABEL'])) {
                 $a['LABEL'] = $arguments['LABEL'];
             }
             if (isset($arguments['ACCESSKEY'])) {
                 $a['ACCESSKEY'] = $arguments['ACCESSKEY'];
             }
         }
         if (!strcmp($option, $this->VALUE)) {
             $a['CHECKED'] = 1;
         }
         if (strlen($error = $form->AddInput($a))) {
             return $error;
         }
     }
     Reset($this->options);
     $this->focus_input = $this->name . Key($this->options);
     return '';
 }
开发者ID:wycus,项目名称:darmedic,代码行数:47,代码来源:form_list_select.php

示例9: test_quoting

function test_quoting(&$message, $test_values, $cs, $quote, $email_header, &$tests, &$failed)
{
    Reset($test_values);
    $end = GetType($value = Key($test_values)) != "string";
    for (; !$end; $tests++) {
        echo "Test value \"", $value, "\"...";
        flush();
        $encoded = $quote ? $message->QuoteText($value) : $message->QuotedPrintableEncode($value, $cs, 1, $email_header);
        if (strcmp($encoded, $test_values[$value])) {
            echo "\tFAIL: returned \"", $encoded, "\" and not \"", $test_values[$value], "\" as expected!\n";
            $failed++;
        } else {
            echo "\tOK!\n";
        }
        Next($test_values);
        $end = GetType($value = Key($test_values)) != "string";
    }
}
开发者ID:anubhaBhargava,项目名称:OpenRecommender,代码行数:18,代码来源:test_quoted_printable.php

示例10: Tokenize

 function Tokenize($string, $separator = "")
 {
     if (!strcmp($separator, "")) {
         $separator = $string;
         $string = $this->next_token;
     }
     for ($character = 0; $character < strlen($separator); $character++) {
         if (GetType($position = strpos($string, $separator[$character])) == "integer") {
             $found = isset($found) ? min($found, $position) : $position;
         }
     }
     if (isset($found)) {
         $this->next_token = substr($string, $found + 1);
         return substr($string, 0, $found);
     } else {
         $this->next_token = "";
         return $string;
     }
 }
开发者ID:BackupTheBerlios,项目名称:ascore,代码行数:19,代码来源:lib_DNS.php

示例11: CopyAddresses

 function CopyAddresses($message, &$results, $header)
 {
     if (!isset($message['Headers'][$header])) {
         return;
     }
     if (!isset($message['ExtractedAddresses'][$header])) {
         $parser = new rfc822_addresses_class();
         $parser->ignore_syntax_errors = $this->ignore_syntax_errors;
         $values = GetType($message['Headers'][$header]) == 'array' ? $message['Headers'][$header] : array($message['Headers'][$header]);
         $tv = count($values);
         $addresses = array();
         for ($v = 0; $v < $tv; ++$v) {
             if ($parser->ParseAddressList($values[$v], $a)) {
                 if ($v == 0) {
                     $addresses = $a;
                 } else {
                     $tl = count($a);
                     for ($l = 0; $l < $tl; ++$l) {
                         $addresses[] = $a[$l];
                     }
                 }
             }
         }
     } else {
         $addresses = $message['ExtractedAddresses'][$header];
     }
     if (count($addresses)) {
         $results[ucfirst(substr($header, 0, strlen($header) - 1))] = $addresses;
     }
 }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:30,代码来源:mime_parser.php

示例12: EscapeSpecialCharacters

 function EscapeSpecialCharacters($string)
 {
     if (GetType($string) != "string") {
         $string = strval($string);
     }
     for ($escaped = "", $character = 0; $character < strlen($string); $character++) {
         switch ($string[$character]) {
             case "\"":
             case ">":
             case "<":
                 $code = Ord($string[$character]);
                 break;
             default:
                 $code = Ord($string[$character]);
                 if ($code < 32 || $code > 127) {
                     break;
                 }
                 $escaped .= $string[$character];
                 continue 2;
         }
         $escaped .= "&#{$code};";
     }
     return $escaped;
 }
开发者ID:BackupTheBerlios,项目名称:zvs,代码行数:24,代码来源:metabase_manager.php

示例13: To

 /**
  * Adds to the "To" recipient collection.
  *
  * @param mixed $RecipientEmail An email (or array of emails) to add to the "To" recipient collection.
  * @param string $RecipientName The recipient name associated with $RecipientEmail. If $RecipientEmail is
  * an array of email addresses, this value will be ignored.
  */
 public function To($RecipientEmail, $RecipientName = '')
 {
     if (is_string($RecipientEmail)) {
         if (strpos($RecipientEmail, ',') > 0) {
             $RecipientEmail = explode(',', $RecipientEmail);
             // trim no need, PhpMailer::AddAnAddress() will do it
             return $this->To($RecipientEmail, $RecipientName);
         }
         if ($this->PhpMailer->SingleTo) {
             return $this->AddTo($RecipientEmail, $RecipientName);
         }
         if (!$this->_IsToSet) {
             $this->_IsToSet = TRUE;
             $this->AddTo($RecipientEmail, $RecipientName);
         } else {
             $this->Cc($RecipientEmail, $RecipientName);
         }
         return $this;
     } elseif ($RecipientEmail instanceof stdClass) {
         $RecipientName = GetValue('Name', $RecipientEmail);
         $RecipientEmail = GetValue('Email', $RecipientEmail);
         return $this->To($RecipientEmail, $RecipientName);
     } elseif ($RecipientEmail instanceof Gdn_DataSet) {
         foreach ($RecipientEmail->ResultObject() as $Object) {
             $this->To($Object);
         }
         return $this;
     } elseif (is_array($RecipientEmail)) {
         $Count = count($RecipientEmail);
         if (!is_array($RecipientName)) {
             $RecipientName = array_fill(0, $Count, '');
         }
         if ($Count == count($RecipientName)) {
             $RecipientEmail = array_combine($RecipientEmail, $RecipientName);
             foreach ($RecipientEmail as $Email => $Name) {
                 $this->To($Email, $Name);
             }
         } else {
             trigger_error(ErrorMessage('Size of arrays do not match', 'Email', 'To'), E_USER_ERROR);
         }
         return $this;
     }
     trigger_error(ErrorMessage('Incorrect first parameter (' . GetType($RecipientEmail) . ') passed to function.', 'Email', 'To'), E_USER_ERROR);
 }
开发者ID:sheldon,项目名称:Garden,代码行数:51,代码来源:class.email.php

示例14: RestoreCookies

 function RestoreCookies($cookies, $clear = 1)
 {
     $new_cookies = $clear ? array() : $this->cookies;
     for ($secure_cookies = 0, Reset($cookies); $secure_cookies < count($cookies); Next($cookies), $secure_cookies++) {
         $secure = Key($cookies);
         if (GetType($secure) != "integer") {
             return $this->SetError("invalid cookie secure value type (" . serialize($secure) . ")");
         }
         for ($cookie_domain = 0, Reset($cookies[$secure]); $cookie_domain < count($cookies[$secure]); Next($cookies[$secure]), $cookie_domain++) {
             $domain_pattern = Key($cookies[$secure]);
             if (GetType($domain_pattern) != "string") {
                 return $this->SetError("invalid cookie domain value type (" . serialize($domain_pattern) . ")");
             }
             for (Reset($cookies[$secure][$domain_pattern]), $path_part = 0; $path_part < count($cookies[$secure][$domain_pattern]); Next($cookies[$secure][$domain_pattern]), $path_part++) {
                 $path = Key($cookies[$secure][$domain_pattern]);
                 if (GetType($path) != "string" || strcmp(substr($path, 0, 1), "/")) {
                     return $this->SetError("invalid cookie path value type (" . serialize($path) . ")");
                 }
                 for (Reset($cookies[$secure][$domain_pattern][$path]), $cookie = 0; $cookie < count($cookies[$secure][$domain_pattern][$path]); Next($cookies[$secure][$domain_pattern][$path]), $cookie++) {
                     $cookie_name = Key($cookies[$secure][$domain_pattern][$path]);
                     $expires = $cookies[$secure][$domain_pattern][$path][$cookie_name]["expires"];
                     $value = $cookies[$secure][$domain_pattern][$path][$cookie_name]["value"];
                     if (GetType($expires) != "string" || strlen($expires) && !preg_match("#^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\$#", $expires)) {
                         return $this->SetError("invalid cookie expiry value type (" . serialize($expires) . ")");
                     }
                     $new_cookies[$secure][$domain_pattern][$path][$cookie_name] = array("name" => $cookie_name, "value" => $value, "domain" => $domain_pattern, "path" => $path, "expires" => $expires, "secure" => $secure);
                 }
             }
         }
     }
     $this->cookies = $new_cookies;
     return "";
 }
开发者ID:egregor-dev,项目名称:SatCMS,代码行数:33,代码来源:http.php

示例15: GetCredentials

 function GetCredentials(&$credentials, $defaults, &$interactions)
 {
     Reset($credentials);
     $end = GetType($key = Key($credentials)) != "string";
     for (; !$end;) {
         if (!isset($this->credentials[$key])) {
             if (isset($defaults[$key])) {
                 $credentials[$key] = $defaults[$key];
             } else {
                 $this->error = "the requested credential " . $key . " is not defined";
                 return SASL_NOMECH;
             }
         } else {
             $credentials[$key] = $this->credentials[$key];
         }
         Next($credentials);
         $end = GetType($key = Key($credentials)) != "string";
     }
     return SASL_CONTINUE;
 }
开发者ID:aydancoskun,项目名称:octobercms,代码行数:20,代码来源:sasl.php


注:本文中的GetType函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。