Click here to Skip to main content
15,905,683 members

Comments by cheekycroak (Top 6 by date)

cheekycroak 18-Nov-23 4:32am View    
"As suggested by Richard Deeming two days ago" - I do not agree with that response Richard. Please see all of the above response that was provided to me. I am not going to argue and just want to close this query.
cheekycroak 18-Nov-23 4:01am View    
Deleted
I had another expert help me to resolve the issue. Below is the code for any future reference in case anyone is stuck like me. Appreciate everyone's help and time to reach a solution.

$url = trim($playlistSong->filename);
$url = str_replace("\\", "/", $url);
$url = str_replace("D:/", "https://mywebsite.com/", $url);
$url = str_replace("d:/", "https://mywebsite.com/", $url);

The HTML player now plays the song after the STR_replace:

https://m.tamilragam.com/albums_song.php?album=2006%20Hits

https://tamilragam.com/artist_song.php?artist=A.%20R.%20Rahman
cheekycroak 16-Nov-23 5:37am View    
Here is the code from my PHP page:
$url = $playlistSong->filename;
$url = str_replace(["\\","D:/"], ["/", "https://m.tamilragam.com/"], $url);
echo $url;
Screenshot of the code from the PHP page:https://m.tamilragam.com/php_code1.png
cheekycroak 16-Nov-23 5:17am View    
I am not doing any conversion as I would expect the str_replace to convert the path by pulling data from the database table name called 'filename'.

See the example from a database table: https://m.tamilragam.com/database_details.png

Please see the screenshot of the PHP code: https://m.tamilragam.com/php_code1.png

Final output on the test webpage: https://m.tamilragam.com/test1.albums_song.php?album=2000%20Hits

"Please edit your question and show the complete code that you are using, from where you capture the initial value, to where you add the final value to the web page." - I have provided screenshots and the codes used in my Solution 3 to Andre after responding to you.
cheekycroak 16-Nov-23 4:18am View    
Thank you, Richard, I changed it, and here's the result as per the screenshot:

https://m.tamilragam.com/richard.png
It still won't convert it to "https://m.tamilragam.com/Music/2000 Hits/Album.Mp3" so the HTML player can pick up the link.