A Utility Function to find the common prefix between first and last strings
< ? php function commonPrefixUtil ( $ str1 , $ str2 ) { $ result = " " ; $ n1 = strlen ( $ str1 ) ; $ n2 = strlen ( $ str2 ) ;