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

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -