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


PHP Str::finish方法代码示例

本文整理汇总了PHP中Str::finish方法的典型用法代码示例。如果您正苦于以下问题:PHP Str::finish方法的具体用法?PHP Str::finish怎么用?PHP Str::finish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Str的用法示例。


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

示例1: __construct

 public function __construct($query, &$conn, &$orm = null)
 {
     $this->conn = $conn;
     $this->res = null;
     $this->orm = $orm;
     $this->rowOrm = null;
     $this->success = false;
     $this->fields = null;
     $this->EOF = true;
     $this->BOF = true;
     $this->index = 0;
     $this->count = 0;
     $this->insertID = 0;
     $type = strtolower(substr(trim(str_replace("\n", " ", $query)), 0, 7));
     $typeIsSelect = $type == "select ";
     $typeIsShowTables = $type == "show ta";
     $typeIsInsert = $type == "insert ";
     $query = Str::finish($query, ";");
     if ($this->res = @mysql_query($query, $this->conn->res)) {
         $this->success = true;
         if ($typeIsSelect || $typeIsShowTables) {
             $this->count = mysql_num_rows($this->res);
             $this->moveFirst();
         } else {
             if ($typeIsInsert) {
                 $this->insertID = mysql_insert_id($this->conn->res);
             }
         }
     } else {
         trigger_error("SQL error: " . $query . "\n<br><b>'" . mysql_error($this->conn->res) . "'</b>");
     }
 }
开发者ID:jura-php,项目名称:jura,代码行数:32,代码来源:MysqlRecordSet.php

示例2: bindUrls

 /**
  * Bind URLs
  *
  * @return void
  */
 public function bindUrls()
 {
     $root = \Str::finish(URL::to('/'), '/');
     $urls = ['root' => $root, 'feed' => $root . 'feed', 'archives' => $root . 'archives', 'search' => $root . 'search', 'assets' => $root . 'assets'];
     foreach ($urls as $key => $value) {
         App::instance("url.{$key}", $value);
     }
 }
开发者ID:a11enwong,项目名称:pochika,代码行数:13,代码来源:Pochika.php

示例3: str_finish

 /**
  * Cap a string with a single instance of a given value.
  *
  * @param  string  $value
  * @param  string  $cap
  * @return string
  */
 function str_finish($value, $cap)
 {
     return Str::finish($value, $cap);
 }
开发者ID:runningjack,项目名称:busticketAPI1,代码行数:11,代码来源:helpers.php

示例4: formatDir

 public static function formatDir($path)
 {
     return Str::finish($path, DS);
 }
开发者ID:jura-php,项目名称:jura,代码行数:4,代码来源:File.php

示例5: rootURL

 public static function rootURL()
 {
     if (is_null(static::$rootURL)) {
         $protocol = strtolower(array_get(static::$server, "SERVER_PROTOCOL", "http"));
         $protocol = substr($protocol, 0, strpos($protocol, "/")) . (static::isSecure() ? "s" : "");
         $port = array_get(static::$server, "SERVER_PORT", "80");
         $port = $port == "80" ? "" : ":" . $port;
         if (static::isPreview() && $port == ":8080") {
             $port = "";
         }
         $uri = static::fullURI();
         $pathInfo = static::pathInfo();
         if ($pathInfo != "/") {
             $uri = substr($uri, 0, strpos($uri, $pathInfo));
         }
         $uri = explode("?", $uri);
         $uri = $uri[0];
         static::$rootURL = Str::finish($protocol . "://" . array_get(static::$server, "SERVER_NAME", "localhost") . $port . $uri, "/");
     }
     return static::$rootURL;
 }
开发者ID:jura-php,项目名称:jura,代码行数:21,代码来源:Request.php


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