Jump to content

[SOLVED] Renaming a File EXTENSION


Warptweet

Recommended Posts

Heres a bit different of a problem I have now...

How can I rename a file EXTENSION??? Can somebody help?
I think it has to do with...

[code]<?php
rename("XXX","XXX")
?>[/code]

Except I don't know what the stuff inside the ""'s do.
Can somebody explain to me how I would not rename a file, but change it from a .swf file to a .txt file, while keeping the same name besides the extension change?
And after that, I need to write these variables...

$flashname = $_POST['flashname']
$flashauthor = $_POST['flashauthor']
$flashdescription = $_POST['flashdescription']

I think I know how to write those variables myself though. I mainly need help with the extension changing, thanks!
Link to comment
https://forums.phpfreaks.com/topic/32815-solved-renaming-a-file-extension/
Share on other sites

Thanks.
I have one more question....

When I write to a file, can I use a variable this way?

[code]$stringData = "$flashname";
    fwrite($fh, $stringData);[/code]

As you can see, I used $stringData = "$flashname";, is that possible to use? Or will I get an error? If I can't how can I make $stringData = $flashname?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.