HaruPage::measureText

(PECL haru >= 0.0.1)

HaruPage::measureTextCalculate the byte length of characters which can be included on one line of the specified width

说锟斤拷

HaruPage::measureText ( string $text , float $width [, bool $wordwrap = FALSE ] ) : int

Get the byte length of characters which can be included on one line of the specified width.

锟斤拷锟斤拷

text

The text to measure.

width

The width of the line.

wordwrap

When this parameter is set to TRUE the function "emulates" word wrapping by stopping after the last full word (delimited by whitespace) that can fit on the line.

锟斤拷锟斤拷值

Returns the byte length of characters which can be included within the specified width. For single-byte encodings, this is equal to the number of characters. For multi-byte encodings, this is not necessarily the case.

锟斤拷锟斤拷锟届常

锟斤拷锟斤拷锟斤拷锟斤拷时锟阶筹拷 HaruException 锟届常锟斤拷

锟轿硷拷