Filtering out highest integer from an array of links

nakazawa

New Member
But of a confusing title so let me explain. I have an array of links like this:\[code\]http://somesite.com/videoplayback?ip=81.0.0.0&sparams=id,expire,ip,ipbits,itag,algorithm,burst,factor&fexp=905602&algorithm=throttle-factor&itag=34&ipbits=8&burst=40&sver=3&expire=1285056000&key=yt1&signature=690F9475D5288F3129F84364427B2B490B6ACE59.45C8F83DEE3DD361855B12AE538EA6349FF8EF9B&factor=1.25&id=d50e6528eb51ad54,18http://somesite.com/videoplayback?ip=81.0.0.0&sparams=id,expire,ip,ipbits,itag,algorithm,burst,factor&fexp=905602&algorithm=throttle-factor&itag=18&ipbits=8&burst=40&sver=3&expire=1285056000&key=yt1&signature=A68EAA3F7A2ECA2BB2BD6C35BF443C03E4BB1172.AD2FF9FDAF046B23F789FE1A7F7882DF9A355DE4&factor=1.25&id=d50e6528eb51ad54,5http://somesite.com/videoplayback?ip=81.0.0.0&sparams=id,expire,ip,ipbits,itag,algorithm,burst,factor&fexp=905602&algorithm=throttle-factor&itag=5&ipbits=8&burst=40&sver=3&expire=1285056000&key=yt1&signature=ABC8ACF6899C46CC992ECB5F6A6FD7E66383EA3D.0C8B707083203DC1153FB26586A94BFAC64D176B&factor=1.25&id=d50e6528eb51ad54\[/code\]If you look at the very end of those URL's, they have extensions like \[code\],18\[/code\], \[code\],5\[/code\] and there is one last link with no extension like this at all.Now, I need to use the link that has the highest number on the end as possible later in my code. In this example I need to filter out the very first link, because it has the highest integer on the end (\[code\]18\[/code\]).I would use a series of \[code\]if()\[/code\] blocks, but in this case the integers on the end can change so that's not a good solution.So I basically need to go through my array, check which link has the highest integer at the end (note that it is only 2 digits in length) and then store it in another variable.Can anyone provide some sample/psudo code on how to effectively do this?Cheers.
 
Back
Top