Re: I need help with my gallery



On 10 Aug., 17:21, Geoff Berrow <blthe...@xxxxxxxxxxx> wrote:
Message-ID:
<b9058dc3-6a0b-41e3-b779-2496d6acf...@xxxxxxxxxxxxxxxxxxxxxxxxxxx> from
Effix contained the following:

Aah I see I was trying to use trim() to remove the path from the array
but that didnt work :)
Altohug I cant seem to get strrchr to work either, im sorry to be such
a bother. Apparently it strips the path but no filename appears efter
the last /

Don't worry about being confused, it probably has a lot to do with me
being lazy and not explaining properly.

Look at this:

foreach($filename_array as $filename){
$filename= substr(strrchr ($filepath,"/"), 0, 20) ;
...

$filepath in this instance was meant to be the output from your array
(with the path bit that you didn't want)
substr() was being used to strip off the leading '/'.

So it should be:-

foreach($filename_array as $filename){
//strip path so we just have filename
$filename= substr(strrchr ($filename,"/"), 1) ;
...

--
Geoff Berrow  0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011http://slipperyhill.co.uk

Aaah I see now it makes a lot more sense :) I cant belive I didnt
figure that one out myself ofcourse its the filename that needs to be
stripped and not the path as I did.
Thank your very much for your help Geoff! :)
.



Relevant Pages

  • Re: I need help with my gallery
    ... but that didnt work:) ... Altohug I cant seem to get strrchr to work either, ... Apparently it strips the path but no filename appears efter ...
    (comp.lang.php)
  • Re: I need help with my gallery
    ... but that didnt work:) ... a bother. ... Apparently it strips the path but no filename appears efter ...
    (comp.lang.php)
  • Re: Samsung SW-224B cant see any media?
    ... > that didnt work? ... I cant find any drivers I tried turning ... > the drive slower the turning imapi cd burning on and off. ... > I tried uninstalling all my burning apps and nothing ...
    (microsoft.public.windowsxp.hardware)
  • Samsung SW-224B cant see any media?
    ... that didnt work? ... I cant find any drivers I tried turning ... the drive slower the turning imapi cd burning on and off. ... I tried uninstalling all my burning apps and nothing ...
    (microsoft.public.windowsxp.hardware)
  • Re: FILENAME never gets a value when running gawk from a batch file
    ... connects the data stream to the standard input channel. ... in my awk program I have tried to use this in my END statement (since ... the filename does not have any value in before the BEGIN is processed: ... I cant see why this should not work? ...
    (comp.lang.awk)