var url = "http://free.mysite.net/id/demo_video.mp4"; url.replace(url.split('.')[0], 'paid'); Code (JavaScript): when i use in my php page it show blank page...
How are you using it in your PHP page? url (variable) needs to be printed (document.write to start with) to be visible. Try something like this: var url = "http://free.mysite.net/id/demo_video.mp4"; url = url.replace(url.split("//")[1].split(".")[0], "paid"); document.write(url); Code (markup):