How can a PHP script be used to change the file extension from mp3 to m3u for streaming audio?

To change the file extension from mp3 to m3u for streaming audio using a PHP script, you can use the `rename()` function. This function renames a file or directory. You just need to specify the old file name (with the mp3 extension) and the new file name (with the m3u extension) as arguments to the function.

$oldFileName = 'audio.mp3';
$newFileName = 'audio.m3u';

if(rename($oldFileName, $newFileName)) {
    echo "File extension changed successfully.";
} else {
    echo "Error changing file extension.";
}