PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Darkside
Forum Commoner
Posts: 43 Joined: Wed Oct 30, 2002 4:18 pm
Post
by Darkside » Fri Feb 21, 2003 9:06 pm
How could I drop the ending of a file name and then add differnt ends later in the code?
lazy_yogi
Forum Contributor
Posts: 243 Joined: Fri Jan 24, 2003 3:27 am
Post
by lazy_yogi » Fri Feb 21, 2003 10:05 pm
$filename = preg_replace('/\.\w+$/','',$filename);
then to add it .txt do
$filename .= ".txt";
and similar to add whatever else
Darkside
Forum Commoner
Posts: 43 Joined: Wed Oct 30, 2002 4:18 pm
Post
by Darkside » Fri Feb 21, 2003 10:06 pm
thanks very much
your like the only dood on this late
lazy_yogi
Forum Contributor
Posts: 243 Joined: Fri Jan 24, 2003 3:27 am
Post
by lazy_yogi » Sat Feb 22, 2003 1:53 am
It's not late ..... it's not even 7 pm here ....