当前位置: 首页>>代码示例>>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;未经允许,请勿转载。