php Programming Glossary: strcommonmaxlength
finding common prefix of array of strings http://stackoverflow.com/questions/1336207/finding-common-prefix-of-array-of-strings if strCommonMax false return false if strCommonMax return strCommonMaxLength strlen strCommonMax Now start looping from the 3rd string echo.. looping from the 3rd string echo n for i 2 i arrLength strCommonMaxLength 1 i echo STR i t arr i n Compare the maximum common string with.. Iterate from string end to string beginning for ii strCommonMaxLength 1 ii 0 ii echo Match ii t echo str_pad arr i ii ii 1 STR_PAD_LEFT..
|