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.
> 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 :)
--
Mail sent to my "From:" address is publicly readable at
http://www.dodgeit.com/
== ** ## !! !! ## ** ==
TEXT-ONLY mail to the complete "Reply-To:" address ("My Name" <my@address>) may
bypass the spam filter. I will answer all pertinent mails from a valid address.