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


PHP TextHelper::urlify方法代碼示例

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


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

示例1: testUrlify

 public function testUrlify()
 {
     $this->assertEquals("simple-test-case", $this->object->urlify("This is a simple test case"));
     $this->assertEquals('jetudie-le-francais', $this->object->urlify(' J\'étudie le français '));
     $this->assertEquals('lo-siento-no-hablo-espanol', $this->object->urlify('Lo siento, no hablo español.'));
     $this->assertEquals('f3pws', $this->object->urlify('ΦΞΠΏΣ'));
     $this->assertEquals('yo-hablo-espanol', $this->object->urlify('¿Yo hablo español?'));
     // Test for many rounds with a language, that has no map associated
     // This causes a "regular expression is too large" error on old versions
     for ($i = 0; $i < 1000; $i++) {
         $this->object->urlify('Lo siento, no hablo español.', 60, -1);
     }
 }
開發者ID:ojalehto,項目名稱:concrete5-legacy,代碼行數:13,代碼來源:TextHelperTest.php

示例2: testUrlify_regexTooLarge

 /**
  * Test for many rounds with a language, that has no map associated
  * This causes a "regular expression is too large" error on old versions
  */
 public function testUrlify_regexTooLarge()
 {
     for ($i = 0; $i < 1000; $i++) {
         $this->object->urlify('Lo siento, no hablo español.', 60, -1);
     }
 }
開發者ID:ceko,項目名稱:concrete5-1,代碼行數:10,代碼來源:TextTest.php


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