欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP字符過(guò)濾函數(shù)去除字符串最后一個(gè)逗號(hào)(rtrim)

 更新時(shí)間:2013年03月26日 22:59:08   作者:  
PHP字符過(guò)濾函數(shù)去除字符串最后一個(gè)逗號(hào),用php自帶的函數(shù)比較容易解決

首先分別解釋下,

trim過(guò)濾字符串兩端,
rtrim過(guò)濾字符串尾部,=chop()
ltrim過(guò)濾字符串首部.

過(guò)濾字符串中鍵的咚咚就只能用str_replace咯.
舉個(gè)例子說(shuō)明下,

PHP代碼

復(fù)制代碼 代碼如下:

$str = '123,333,234,';
echo rtrim($str, ',');

rtrim實(shí)例代碼2

復(fù)制代碼 代碼如下:

<?php
$text = "\t\tThese are a few words :) ...  ";
$trimmed = rtrim($text);
// $trimmed = "\t\tThese are a few words :) ..."
$trimmed = rtrim($text, " \t.");
// $trimmed = "\t\tThese are a few words :)"
$clean = rtrim($binary, "\x00..\x1F");
// trim the ASCII control characters at the end of $binary
// (from 0 to 31 inclusive)
?>

相關(guān)文章

最新評(píng)論