Need to check longest prefix of a number
<p>I've an array i.e. $arr(22, 123, 12345, 1234)
After user input a value i.e. 123456789 I need to check longest prefix exist in array or not. In above input case $arr[2] will be answer. If input is 123000 the answer will be $arr[1]. Input can be of any length. </p>

<p>Php hint will be appreciable </p>
