mtownsend
11/15/2018 - 8:53 PM

substri_count

<?php

if (!function_exists('substri_count')) {

    /**
     * Check the number of times a needle is found in a haystack
     *
     * @param (string) $haystack | (string) $needle
     * @return (integer)
     */
    function substri_count($haystack, $needle)
    {
        return substr_count(strtoupper($haystack), strtoupper($needle));
    }
}