Select file(s) in a directory based upon complex filename

Posted by zx on Stack Overflow See other posts from Stack Overflow or by zx
Published on 2010-04-24T01:51:06Z Indexed on 2010/04/24 2:23 UTC
Read the original article Hit count: 212

Filed under:

hi,

I have audio files in var/

This is the file name

2-3109999999-3246758493-1271129518-1271129505.6.wav

Format
2=campaign id
3109999999=caller id
3246758493=number called
1271129518=timestamp call ended
1271129505=timestamp call started
6=call id

If I were to pass just the number called which was 3246758493, how can I find all the files without defining all the other variables(such as timestamp, etc) and just the files that have that number in the filename?

© Stack Overflow or respective owner

Related posts about php