I have a changeable list of files that need to be sent as email attachments. My cgi app can process and assemble the list then pass it on to PHP.
I'm running into trouble when trying to put the files and their paths into an array.
This works:
And this works:
So this should work, but it fails to find the files:
I've tried other variations but can't find a way to handle it.
The need is to find a format with the path and file name that I can pass to PHP as I've done in $filelist above. I can't see any other way to provide an array of file names and combine them with the path to make the equivalent of $path.'/ThisFile.pdf',$path.'/ThatFile.pdf'
I'm running into trouble when trying to put the files and their paths into an array.
This works:
PHP Code:
$path = '/Library/WebServer/Documents/TheSite/TheFiles';
$files = array($path.'/ThisFile.pdf',$path.'/ThatFile.pdf');
PHP Code:
$files = array('/Library/WebServer/Documents/TheSite/TheFiles/ThisFile.pdf','/Library/WebServer/Documents/TheSite/TheFiles/ThatFile.pdf');
PHP Code:
$filelist = '/Library/WebServer/Documents/TheSite/TheFiles/ThisFile.pdf','/Library/WebServer/Documents/TheSite/TheFiles/ThatFile.pdf';
$files = array($filelist);
The need is to find a format with the path and file name that I can pass to PHP as I've done in $filelist above. I can't see any other way to provide an array of file names and combine them with the path to make the equivalent of $path.'/ThisFile.pdf',$path.'/ThatFile.pdf'
Comment