當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。