本文整理匯總了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);
}
}
示例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);
}
}