|
Posted by Steve on 09/25/07 03:33
"macca" <ptmcnally@googlemail.com> wrote in message
news:1190679385.207430.268930@r29g2000hsg.googlegroups.com...
> >From the original post:
>
> Basically, I want to use the filename of a web page
> within the <title> tags in the page <head>.
> <snip>
> So I just need PHP to look
> up the filename without the extension, capitalize the first letter,
> and then have the ability to call it within <title>.
>
>
> My function soes exactly what he asked for.
only if that file name has an extension. follow the logic...just because he
says 'without the extension', it certainly does not mean that all of his
files *have* extensions. you do not have enough information to assume
anything else correctly. also, your function doesn't account for sym-links -
a lot of which DON'T have extensions...by choice.
anyway, say what you want. i just know that if you try and throw a wrench
(an exception to the rule) at what i wrote, my example will still work.
notice that i also ucwords()...since i think about the result he wants
rather than just the details he provides. i'd hate to have to go in and
modify this thing the first time someone named a file 'free pictures.php'.
good thing i wouldn't have to.
;^)
[Back to original message]
|