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
Post a Comment