/**
 * Counts the number of substring occurrences.
 * @param string $haystack				The string being checked.
 * @param string $needle				The string being found.
 * @param string $encoding (optional)	The used internally by this function character encoding.
 * If it is omitted, the platform character set will be used by default.
 * @return int							The number of times the needle substring occurs in the haystack string.
 * @link http://php.net/manual/en/function.mb-substr-count.php
 */
function api_substr_count($haystack, $needle, $encoding = null)
{
    return Utf8::substr_count($haystack, $needle);
}