$arr1 = array ("llo" "world", "ef", "gh" );
What's the best way to check if $str1 ends with some string from $arr1?
The answer true/false is great, although knowing the number of $arr1 element as an answer (if true) would be great.
Example:
$pos= check_end("world hello");//$pos=0; because ends with llo
$pos= check_end("hello world");//$pos=1; because ends with world.
Is there any better/faster/special way than just comparing in for-statement all elements of $arr1 with the end of $str1?
$arr1be an ending substring of another value of$arr1? Because if s/t like$arr1 = array('llo', 'lo', 'hi')is possible, you need to further clarify which element's number should be returned in case of multiple matches.