General'; 'Jon Haworth'
> Subject: RE: [PHP] Getting part of a string...Was protecting
> a file via php
>
>
> Thanks to all so far.
> However I am still having problems I have directory outside
> the root with PDF's in it. The links to the PDF files ar
Thanks to all so far.
However I am still having problems I have directory outside the root
with PDF's in it. The links to the PDF files are called successfully by
this function in a page I call getlinks.php
function do_non_root_links()
{
define('FILEDIR', '/home/.sites/144/site281/downloads/');
/
* Thus wrote Jon Haworth ([EMAIL PROTECTED]):
> Hi Steve,
>
> > $pfile = str_replace('get.php?file=','','$file');
> > $p = explode('.', $pfile);
> > // How do I say look at the extension and put it into the switch?
> > $extension = $p;
> > // end of the bit I'm stuck on.
>
> At this point $p is a
On Tuesday 16 September 2003 21:24, Jon Haworth wrote:
> At this point $p is an array rather than a variable, so you'll need to get
> the last element of $p.Try something like this:
>
> $p = explode('.', $pfile);
> $extension = $p[sizeof($p)-1];
Better still, use array_pop().
--
Jason Wong -> G
If you use pathinfo($pfile), you'll get an array with the dirname,
basename and extension...
Jrgns
--
<><
[EMAIL PROTECTED]
083 511 7932
"For those who believe no evidence is necessary.
For those who don't, no evidence would suffice."
--
PHP General Mailing List (http://www.php.net/)
To unsubscri
Hi Steve,
> $pfile = str_replace('get.php?file=','','$file');
> $p = explode('.', $pfile);
> // How do I say look at the extension and put it into the switch?
> $extension = $p;
> // end of the bit I'm stuck on.
At this point $p is an array rather than a variable, so you'll need to get
the last e
6 matches
Mail list logo