On Feb 12, 2008, at 4:35 PM, Ash wrote:

Is there a faster way to do this? Explanation below if this doesn't make sense.

$infile = "J-$Month-rs.pdf";

if (!file_exists($infile)){
$infile = "J-$Month-rp.pdf";
       }
if (!file_exists($infile)){
$infile = "J-$Month-ms.pdf";
       }
if (!file_exists($infile)){
$infile = "J-$Month-mp.pdf";
       }
if (!file_exists($infile)){
$infile = "J-$Month-rx.pdf";
       }
if (!file_exists($infile)){
$infile = "J-$Month-mx.pdf";
       }
if (!file_exists($infile)){
$infile = "J-$Month-xs.pdf";
       }
if (!file_exists($infile)){
$infile = "J-$Month-xp.pdf";
       }
if (!file_exists($infile)){
$infile = "J-$Month-xx.pdf";
       }


What about this:

$files = glob("J-$Month-*.pdf");

Then use $files[0] (or do they have to checked in order?)



_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to