echo repeatedString("mango", 10);
function repeatedString($string, $number) {
$ltr = 'a'; //letter function
$strl = strlen($string);
$res = substr_count($string, $ltr)*floor($number/$strl);
$res += substr_count(substr($string, 0, $number%$strl), $ltr);
}
return $res;