Using glob
and regex with preg_match
you can find the files:
<?php
// define which app
$app = "app1";
// Search the directory for possible matches
foreach (glob("/com.name.".$app."*") as $filename) {
$filename . "\n";
preg_match('/\\d\\.\\d-\\d_.*\\.deb/', $filename, $matches);
echo "filename: com.name.".$app."_{$matches[0]}\n";
}
?>
Result:
com.name.app1_1.0-1_iphoneos-arm.deb