PHP check if file exists on my server, based on a full URL
<p>I have an app that generates invoices in the form of PDF files stored in a directory on my server. Before mailing out this invoices I'd like to make sure that the URL (not server path) which I store in my DB does indeed point to a valid PDF file. </p>

<p>Something could have gone wrong that wrote a value to that field in the db, but for example the filename is missing; meaning the file is not in the specified directory.</p>

<p>AFAIK file_exists just checks server paths but not URL's.</p>

<p>I could always store the server path too, or assemble it, but I'm wondering if i can do this check based on a full http url ending with a filename?</p>

<p>EDIT: yeah CURL occurred to me too but doesn't that seem a bit heavy for such a simple task? Perhaps I should just store the server path too.</p>
