tags:

views:

21

answers:

1

I am simply trying to set a variable to a filename, I know the start and end of the filename, but part of the filename is date stamped and is therefore variable.

However this simple test gives me an error

<?php 
$apps = (glob('/var/www/vhosts/smartphonesoft.com/httpdocs/fred/epf/file*.tbz');
echo $apps;
?>

PHP Parse error: syntax error, unexpected ';' in /var/www/vhosts/smartphonesoft.com/httpdocs/fred/showfile.php on line 8

+2  A: 

You have an opening bracket that is not closed:

$apps = (glob('/var/www/vhosts/smartphonesoft.com/httpdocs/fred/epf/file*.tbz');
--------^

Also, I am not sure what you are trying to achieve by putting it into brackets or by echo'ing it. glob will always return an array of matching filenames. If no file is matched, the array will be empty. Try print_r($apps) to see what glob matched.

Gordon