Richard has given you a close to perfect solution but it returned the same path to your D: drive as to where you wanted a result of the online url, I have edited it a little which results in the exact output you require. I have hardcoded your path, just edit the '$playlistSong' back to your '$playlistSong->filename' -
$playlistSong = 'D:\Music\2000 Hits\Album.Mp3';
$modifiedString = str_replace('D:\\', 'https://mywebsite.com/', $playlistSong);
$modifiedString = str_replace('\\', '/', $modifiedString);
echo $modifiedString;
The output will be 'https://mywebsite.com/Music/2000 Hits/Album.Mp3' which you can run as a test in the W3 Editor at -
PHP compiler[
^]
When you try to replace a backslash, which is an escape character in PHP strings, it will error, you have to use double backslashes -
Replace backslashes with PHP str_replace or regex preg_replace[
^]