PHP 클래스 DaveChild\TextStatistics\Text

파일 보기 프로젝트 열기: nystudio107/seomatic 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$blnMbstring boolean Efficiency: Is the MB String extension loaded?
$clean array Efficiency: Store strings once processed.

공개 메소드들

메소드 설명
averageWordsPerSentence ( string $strText, string $strEncoding = '' ) : integer | float Returns average words per sentence for text.
characterCount ( string $strText, string $strEncoding = '' ) : integer Alias for textLength, as "letterCount", "wordCount" etc also used
cleanText ( string | boolean $strText ) : string Trims, removes line breaks, multiple spaces and generally cleans text before processing.
letterCount ( string $strText, string $strEncoding = '' ) : integer Gives letter count (ignores all non-letters). Tries mb_strlen and if that fails uses regular strlen.
lowerCase ( string $strText, string $strEncoding = '' ) : string Converts string to lower case. Tries mb_strtolower and if that fails uses regular strtolower.
sentenceCount ( string $strText, string $strEncoding = '' ) : integer Returns sentence count for text.
substring ( string $strText, integer $intStart, integer $intLength, string $strEncoding = '' ) : string Gets portion of string. Tries mb_substr and if that fails uses regular substr.
textLength ( string $strText, string $strEncoding = '' ) : integer Gives string length. Tries mb_strlen and if that fails uses regular strlen.
upperCase ( string $strText, string $strEncoding = '' ) : string Converts string to upper case. Tries mb_strtoupper and if that fails uses regular strtoupper.
wordCount ( string $strText, string $strEncoding = '' ) : integer Returns word count for text.

메소드 상세

averageWordsPerSentence() 공개 정적인 메소드

Returns average words per sentence for text.
public static averageWordsPerSentence ( string $strText, string $strEncoding = '' ) : integer | float
$strText string Text to be measured
$strEncoding string Encoding of text
리턴 integer | float

characterCount() 공개 정적인 메소드

Alias for textLength, as "letterCount", "wordCount" etc also used
public static characterCount ( string $strText, string $strEncoding = '' ) : integer
$strText string Text to be measured
$strEncoding string Encoding of text
리턴 integer

cleanText() 공개 정적인 메소드

Trims, removes line breaks, multiple spaces and generally cleans text before processing.
public static cleanText ( string | boolean $strText ) : string
$strText string | boolean Text to be transformed
리턴 string

letterCount() 공개 정적인 메소드

Gives letter count (ignores all non-letters). Tries mb_strlen and if that fails uses regular strlen.
public static letterCount ( string $strText, string $strEncoding = '' ) : integer
$strText string Text to be measured
$strEncoding string Encoding of text
리턴 integer

lowerCase() 공개 정적인 메소드

Converts string to lower case. Tries mb_strtolower and if that fails uses regular strtolower.
public static lowerCase ( string $strText, string $strEncoding = '' ) : string
$strText string Text to be transformed
$strEncoding string Encoding of text
리턴 string

sentenceCount() 공개 정적인 메소드

Returns sentence count for text.
public static sentenceCount ( string $strText, string $strEncoding = '' ) : integer
$strText string Text to be measured
$strEncoding string Encoding of text
리턴 integer

substring() 공개 정적인 메소드

Gets portion of string. Tries mb_substr and if that fails uses regular substr.
public static substring ( string $strText, integer $intStart, integer $intLength, string $strEncoding = '' ) : string
$strText string Text to be cut up
$intStart integer Start character
$intLength integer Length
$strEncoding string Encoding of text
리턴 string

textLength() 공개 정적인 메소드

Gives string length. Tries mb_strlen and if that fails uses regular strlen.
public static textLength ( string $strText, string $strEncoding = '' ) : integer
$strText string Text to be measured
$strEncoding string Encoding of text
리턴 integer

upperCase() 공개 정적인 메소드

Converts string to upper case. Tries mb_strtoupper and if that fails uses regular strtoupper.
public static upperCase ( string $strText, string $strEncoding = '' ) : string
$strText string Text to be transformed
$strEncoding string Encoding of text
리턴 string

wordCount() 공개 정적인 메소드

Returns word count for text.
public static wordCount ( string $strText, string $strEncoding = '' ) : integer
$strText string Text to be measured
$strEncoding string Encoding of text
리턴 integer

프로퍼티 상세

$blnMbstring 보호되어 있는 정적으로 프로퍼티

Efficiency: Is the MB String extension loaded?
protected static bool $blnMbstring
리턴 boolean

$clean 보호되어 있는 정적으로 프로퍼티

Efficiency: Store strings once processed.
protected static array $clean
리턴 array