View Single Post

  #9 (permalink)  
Old 11-16-2004
Erich Musick
 
Posts: n/a
Default Re: Directory listing with file info



Pedro Graca wrote:
> Erich Musick top-posted (and I changed the format):
>
>>Pedro Graca wrote:
>>
>>>Kim Jensen wrote:
>>>
>>>
>>>>Here I'd like the $val after the name= to be just the filename without
>>>>the extention (all files in the directory are txt files)

>
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>
>>>echo '<a href="test.php?name=', substr($val, -4), ">$val</a><br";

>>
>>This method, though, assumes that all extensions are exactly three
>>characters long.

>
>
> Yes, as the OP stated.
>
>


My bad - failed to notice that :)

>>What about extensions such as pl, py, h, among others?

>
>
> In this case, it didn't seem necessary to make a generic function -- but
> I agree that would have been a better option from the start :)
>


--
In Christ,

Erich Musick
http://erichmusick.com

In the same way, let your light shine before others, so that they may
see your good works and give glory to your Father who is in heaven. --
Matthew 5:16 NKJV
Reply With Quote