當前位置: 首頁>>代碼示例>>PHP>>正文


PHP StringUtils::ends_with方法代碼示例

本文整理匯總了PHP中StringUtils::ends_with方法的典型用法代碼示例。如果您正苦於以下問題:PHP StringUtils::ends_with方法的具體用法?PHP StringUtils::ends_with怎麽用?PHP StringUtils::ends_with使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在StringUtils的用法示例。


在下文中一共展示了StringUtils::ends_with方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: is_controller_class

 public static function is_controller_class($class_name)
 {
     return StringUtils::ends_with($class_name, self::CONTROLLER_NAME_SUFFIX);
 }
開發者ID:mbcraft,項目名稱:frozen,代碼行數:4,代碼來源:ControllerFactory.class.php

示例2: str_replace

             $update_name = str_replace('stopfile_', '', $filename);
             $update_name = str_replace('.txt', '', $update_name);
             $updater_utils->record_update($update_name);
         }
     }
     $mysqli->commit();
 }
 /*
  *****   ALL UPDATES SHOULD NOW BE PLACED IN DATESTAMPED FILES IN THE version5 FOLDER   *****
  *
  *****   UPDATE FILES CAN BE CREATED BY RUNNING /updates/create_update.php
  */
 // Run individual update files
 $files = scandir($migration_path);
 foreach ($files as $file) {
     if (StringUtils::ends_with($file, '.php')) {
         include $migration_path . '/' . $file;
         $mysqli->commit();
     }
 }
 $mysqli->commit();
 /*
  *****   NOW UPDATE THE INSTALLER SCRIPT   *****
  */
 // End of updates -----------------------------------------------------------------
 // Final housekeeping activities - put all updates above this line
 $updated = $updater_utils->update_version($version, $string, $cfg_web_root);
 if ($updated !== true) {
     echo "<li class=\"error\">" . $string['couldnotwrite'] . "</li>";
 }
 $updater_utils->execute_query('FLUSH PRIVILEGES', true);
開發者ID:vinod-co,項目名稱:centa,代碼行數:31,代碼來源:version5.php

示例3: field_needs_quotes

 private function field_needs_quotes($field)
 {
     $all_fields = $this->__getAllFields();
     $type = $all_fields[$field]["type"];
     if (StringUtils::ends_with($type, "text") || StringUtils::starts_with($type, "varchar") || StringUtils::starts_with($type, "date") || StringUtils::starts_with($type, "time")) {
         return true;
     } else {
         return false;
     }
 }
開發者ID:mbcraft,項目名稱:frozen,代碼行數:10,代碼來源:AbstractPeer.class.php

示例4: set_tolerance_value

 /**
  * Set the full marks tolerance for the question
  * @param unknown_type $value
  */
 private function set_tolerance_value($value, $type_string, &$val_target, &$type_target)
 {
     if (StringUtils::ends_with($value, '%')) {
         $val = rtrim($value, '%');
         $type = '%';
     } else {
         $val = $value;
         $type = '#';
     }
     if ($val != $val_target or $type != $type_target) {
         $old_type = $type_target == '#' ? '' : $type_target;
         $type_target = $type;
         $this->set_modified_field($type_string, $val_target . $old_type);
         $val_target = $val;
     }
 }
開發者ID:vinod-co,項目名稱:centa,代碼行數:20,代碼來源:question_enhancedcalc.class.php

示例5: testEndsWith

 function testEndsWith()
 {
     $this->assertTrue(StringUtils::ends_with("ProvaDiRegistrazione", "Registrazione"), "Il controllo di fine stringa non e' corretto!!");
     $this->assertFalse(StringUtils::ends_with("ProvaDiRegistrazione", "zionerr"), "Il controllo di fine stringa non e' corretto!!");
     $this->assertFalse(StringUtils::ends_with("ProvaDiRegistrazione", "Prova"), "Il controllo di fine stringa non e' corretto!!");
 }
開發者ID:mbcraft,項目名稱:frozen,代碼行數:6,代碼來源:string_utils_test.php


注:本文中的StringUtils::ends_with方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。