<?php

namespace ScfPriceUpdater;

final class Utils {

    /**
     * Get the string between two other given strings
     * @param string $str Haystack string
     * @param string $start Starting string
     * @param string $end Ending string
     * @return false|string String between start and end
     */
    public static function getBetweenStr(string $str, string $start, string $end)
    {
        $pos_string = stripos($str, $start);
        $substr_data = substr($str, $pos_string);
        $string_two = substr($substr_data, strlen($start));
        $second_pos = stripos($string_two, $end);
        $string_three = substr($string_two, 0, $second_pos);
        return trim($string_three);
    }
}