本文整理汇总了PHP中utf8_ltrim函数的典型用法代码示例。如果您正苦于以下问题:PHP utf8_ltrim函数的具体用法?PHP utf8_ltrim怎么用?PHP utf8_ltrim使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了utf8_ltrim函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: utf8_trim
/**
* UTF-8 aware replacement for trim()
* Note: you only need to use this if you are supplying the charlist
* optional arg and it contains UTF-8 characters. Otherwise trim will
* work normally on a UTF-8 string
* @author Andreas Gohr <[email protected]>
* @see http://www.php.net/trim
* @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php
* @return string
* @package utf8
* @subpackage strings
*/
function utf8_trim($str, $charlist = FALSE)
{
if ($charlist === FALSE) {
return trim($str);
}
return utf8_ltrim(utf8_rtrim($str, $charlist), $charlist);
}
开发者ID:RangerWalt,项目名称:ecci,代码行数:19,代码来源:trim.php
示例2: ltrim
/**
* UTF-8 aware replacement for ltrim()
*
* Strip whitespace (or other characters) from the beginning of a string
* You only need to use this if you are supplying the charlist
* optional arg and it contains UTF-8 characters. Otherwise ltrim will
* work normally on a UTF-8 string
*
* @param string $str The string to be trimmed
* @param string $charlist The optional charlist of additional characters to trim
*
* @return string The trimmed string
*
* @see http://www.php.net/ltrim
* @since 11.1
*/
public static function ltrim($str, $charlist = false)
{
if (empty($charlist) && $charlist !== false) {
return $str;
}
jimport('phputf8.trim');
if ($charlist === false) {
return utf8_ltrim($str);
} else {
return utf8_ltrim($str, $charlist);
}
}
开发者ID:nogsus,项目名称:joomla-platform,代码行数:28,代码来源:string.php
示例3: message
}
if (strlen($title) < 1) {
message($lang_common['Bad request']);
}
$close = isset($_POST['close']) ? intval($_POST['close']) : '2';
$stick = isset($_POST['stick']) ? intval($_POST['stick']) : '2';
$archive = isset($_POST['archive']) ? intval($_POST['archive']) : '2';
$move = isset($_POST['forum']) ? intval($_POST['forum']) : '0';
$leave_redirect = isset($_POST['redirect']) ? intval($_POST['redirect']) : '0';
$insert = array('title' => $title, 'close' => $close, 'stick' => $stick, 'archive' => $archive, 'move' => $move, 'leave_redirect' => $leave_redirect, 'reply_message' => $message, 'add_start' => $add_start, 'add_end' => $add_end, 'send_email' => $send_email, 'increment_posts' => $increment);
$db->insert('multi_moderation', $insert);
redirect(panther_link($panther_url['admin_moderate']), $lang_admin_moderate['added redirect']);
} elseif ($action == 'edit' && $id > '0') {
$message = isset($_POST['message']) ? panther_trim($_POST['message']) : null;
$title = isset($_POST['title']) ? panther_trim($_POST['title']) : null;
$add_start = isset($_POST['add_start']) ? utf8_ltrim($_POST['add_start']) : null;
$add_end = isset($_POST['add_end']) ? utf8_rtrim($_POST['add_end']) : null;
if (strlen($title) > 50) {
message($lang_admin_moderate['title too long']);
}
if (strlen($add_start) > 50 || strlen($add_end) > 50) {
message($lang_admin_moderate['addition too long']);
}
if (strlen($title) < 1) {
message($lang_common['Bad request']);
}
$close = isset($_POST['close']) ? intval($_POST['close']) : '2';
$stick = isset($_POST['stick']) ? intval($_POST['stick']) : '2';
$archive = isset($_POST['archive']) ? intval($_POST['archive']) : '2';
$move = isset($_POST['forum']) ? intval($_POST['forum']) : '0';
$leave_redirect = isset($_POST['redirect']) ? intval($_POST['redirect']) : '0';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:moderate.php
示例4: ltrim
/**
* UTF-8 aware replacement for ltrim()
*
* Strip whitespace (or other characters) from the beginning of a string
* You only need to use this if you are supplying the charlist
* optional arg and it contains UTF-8 characters. Otherwise ltrim will
* work normally on a UTF-8 string
*
* @param string $str The string to be trimmed
* @param string $charlist The optional charlist of additional characters to trim
*
* @return string The trimmed string
*
* @see http://www.php.net/ltrim
* @since 2.0
*/
public static function ltrim($str, $charlist = null)
{
if (empty($charlist) && $charlist !== null) {
return $str;
}
if (!function_exists('utf8_ltrim')) {
require_once __DIR__ . '/phputf8/trim.php';
}
if ($charlist === null) {
return utf8_ltrim($str);
}
return utf8_ltrim($str, $charlist);
}
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:29,代码来源:Utf8String.php
示例5: ltrim
/**
* UTF-8 aware replacement for ltrim()
* Strip whitespace (or other characters) from the beginning of a string
* Note: you only need to use this if you are supplying the charlist
* optional arg and it contains UTF-8 characters. Otherwise ltrim will
* work normally on a UTF-8 string
*
* @static
* @access public
* @param string the string to be trimmed
* @param string the optional charlist of additional characters to trim
* @return string the trimmed string
* @see http://www.php.net/ltrim
*/
public static function ltrim($str, $charlist = FALSE)
{
jimport('phputf8.trim');
if ($charlist === FALSE) {
return utf8_ltrim($str);
} else {
return utf8_ltrim($str, $charlist);
}
}
开发者ID:joebushi,项目名称:joomla,代码行数:23,代码来源:string.php
示例6: utf8_trim
/**
* utf8_trim( )
*
* Strip whitespace or other characters from beginning or end of a UTF-8 string
* @since 1.3
*
* @param string $string The string to be trimmed
* @param string $chrs Optional characters to be stripped
* @return string The trimmed string
*/
function utf8_trim($string = '', $chrs = '')
{
$string = utf8_ltrim($string, $chrs);
return utf8_rtrim($string, $chrs);
}
开发者ID:henrique-lima,项目名称:rabbit-internet,代码行数:15,代码来源:Utf8Parser.php
示例7: ltrim
/**
* UTF-8 aware replacement for ltrim()
*
* Strip whitespace (or other characters) from the beginning of a string
* You only need to use this if you are supplying the charlist
* optional arg and it contains UTF-8 characters. Otherwise ltrim will
* work normally on a UTF-8 string
*
* @param string $str The string to be trimmed
* @param string $charlist The optional charlist of additional characters to trim
*
* @return string The trimmed string
*
* @see http://www.php.net/ltrim
* @since 1.0
*/
public static function ltrim($str, $charlist = false)
{
if (empty($charlist) && $charlist !== false) {
return $str;
}
require_once __DIR__ . '/phputf8/trim.php';
if ($charlist === false) {
return utf8_ltrim($str);
}
return utf8_ltrim($str, $charlist);
}
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:27,代码来源:String.php
示例8: utf8_trim
/**
* Unicode aware replacement for trim()
*
* @author Andreas Gohr <[email protected]>
* @see trim()
* @return string
*/
function utf8_trim($str, $charlist = '')
{
if ($charlist == '') {
return trim($str);
}
return utf8_ltrim(utf8_rtrim($str));
}
开发者ID:BackupTheBerlios,项目名称:stato-svn,代码行数:14,代码来源:utf8_helper.php
示例9: ltrim
/**
* UTF-8 aware replacement for ltrim()
*
* Strip whitespace (or other characters) from the beginning of a string. You only need to use this if you are supplying the charlist
* optional arg and it contains UTF-8 characters. Otherwise ltrim will work normally on a UTF-8 string.
*
* @param string $str The string to be trimmed
* @param string $charlist The optional charlist of additional characters to trim
*
* @return string The trimmed string
*
* @see http://www.php.net/ltrim
* @since 1.3.0
*/
public static function ltrim($str, $charlist = false)
{
if (empty($charlist) && $charlist !== false) {
return $str;
}
if ($charlist === false) {
return utf8_ltrim($str);
}
return utf8_ltrim($str, $charlist);
}
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:24,代码来源:StringHelper.php
示例10: testLinefeedMask
function testLinefeedMask()
{
$str = "ñ\nñtërnâtiônàlizætiøn";
$trimmed = "tërnâtiônàlizætiøn";
$this->assertEqual(utf8_ltrim($str, "ñ\n"), $trimmed);
}
开发者ID:kidwellj,项目名称:scuttle,代码行数:6,代码来源:utf8_trim.test.php
示例11: utf8_trim
/**
* UTF-8 aware replacement for trim().
*
* @author Andreas Gohr <[email protected]>
* @see http://www.php.net/trim
* @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php
* @param string $str
* @param boolean $charlist
* @return string
*/
function utf8_trim($str, $charlist = '')
{
if (empty($charlist)) {
return trim($str);
}
return utf8_ltrim(utf8_rtrim($str, $charlist), $charlist);
}
开发者ID:kidaa30,项目名称:Swevers,代码行数:17,代码来源:text.php
示例12: utf8_ltrim
function utf8_ltrim($str, $charlist = '')
{
return utf8_ltrim($str, $charlist);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:4,代码来源:utf8_integration_test.class.php
注:本文中的utf8_ltrim函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论