Let’s say I have these;
$z1 = substr_count_array($aldi1, "keyword");
$z2 = substr_count_array($aldi2, "keyword");
$z3 = substr_count_array($aldi3, "keyword");
substr_count_array counts the number that how many times our keyword is included in that string.
Now I want to echo string that has the highest count number. I want to echo the string which has highest number. How should I do that ?
Why don’t you store the result from the count in an array. If you store each “aldi” in an array you can do this: