Removing a part of url in php -


i want remove %, +, ascii codes url.

example:

from

 http://prexprint.com/laminated%20business%20cards 

to

 http://prexprint.com/laminated business cards 

there go js:

var orgurl = 'http://prexprint.com/laminated%20business%20cards'; var requrl = decodeuri(orgurl); console.log(requrl); 

edit:

var orgurl = 'http://prexprint.com/laminated%20business%20cards'; var requrl = decodeuri(orgurl) requrl = requrl.replace(/\ /g, '-'); console.log(requrl) window.location.href = requrl 

Comments

Popular posts from this blog

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -