Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: iconv_substr - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

iconv" width="11" height="7"/> <iconv_strrpos
Last updated: Mon, 05 Feb 2007

view this page in

iconv_substr

(PHP 5)

iconv_substr — 文字列の一部を切り出す

説明

string iconv_substr ( string str, int offset [, int length [, string charset]] )

文字列 str の、 startlength で指定された一部を返します。

パラメータ

str

元の文字列。

offset

start が負でない場合、 iconv_substr()strstart 番目の文字(ゼロから数えて)から切り出します。

start が負の場合、 iconv_substr()str の最後から数えて start 番目の文字から切り出します。

length

length が指定され、かつ正である場合、 返される文字列は start から数えて最大 length 文字数分となります (string の長さに依存します)。

もし負の length が渡された場合に iconv_substr() が切り出す文字列は、 strstart 番目の文字からはじまり、文字列の最後から数えて length 文字分戻ったところまでとなります。 start も負の場合、開始位置は 上で説明した方式で計算されます。

charset

charset が指定されなかった場合、文字セットは ini 設定 iconv.internal_encoding で定義された値とみなされます。

offsetlength のパラメータは、常に charset で定義された 文字セットにおける文字数と判断されることに注意してください。 一方、substr() の場合はこれらの値を常に バイト数として判断します。

返り値

文字列 str の、 offsetlength で指定された一部を返します。

もし strstart の文字列長より短い場合は、FALSE が返されます。

参考

substr()
mb_substr()
mb_strcut()



add a note add a note User Contributed Notes
iconv_substr
There are no user contributed notes for this page.

iconv" width="11" height="7"/> <iconv_strrpos
Last updated: Mon, 05 Feb 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites