Encode URL

Is there a module that can make proper URL out of text?

Example: http://somesite.com/soemthing&somethingelse?name=John Smith

In other words, is there a module that can cleanup and make a proper url instead of using replace spaces with β€œ%20” ?

I tried using encodeURL but the URL that it produces results like http%3A%2F%2Fsomesite.com%2Fsoemthing%26somethingelse%3Fname%3DJohn%20Smith

I cannot open the generated URL

@slyfox

You’re close.

Just encode the parameters portion, i.e., β€œ?name=John Smith”.


Jim - The Monday Man (YouTube Channel)
What is Make & How can it help you?
We Create Custom Solutions
Schedule a 1-on-1 Tutorial Session (for monday, Make & Dogs v. Cats)

Got it. I reverted back to using replace() module to replace spaces with %20

2 Likes