StringUtil
in package
String utility.
This class is mainly used to implement the 'text-match' filter, used by both the CalDAV calendar-query REPORT, and CardDAV addressbook-query REPORT. Because they both need it, it was decided to put it in Sabre\DAV instead.
Tags
Table of Contents
- ensureUTF8() : string
- This method takes an input string, checks if it's not valid UTF-8 and attempts to convert it to UTF-8 if it's not.
- textMatch() : bool
- Checks if a needle occurs in a haystack ;).
Methods
ensureUTF8()
This method takes an input string, checks if it's not valid UTF-8 and attempts to convert it to UTF-8 if it's not.
public
static ensureUTF8(string $input) : string
Note that currently this can only convert ISO-8859-1 to UTF-8 (latin-1), anything else will likely fail.
Parameters
- $input : string
Return values
string —textMatch()
Checks if a needle occurs in a haystack ;).
public
static textMatch(string $haystack, string $needle, string $collation[, string $matchType = 'contains' ]) : bool
Parameters
- $haystack : string
- $needle : string
- $collation : string
- $matchType : string = 'contains'