๐ŸŽ‰ New: Top 75 PHP Interview Questions for 2026 โ€” Free for all learners

HTML URL Encode

P
php Guru
ยท ยท 2 min read ยท

๐Ÿ“Œ Key Takeaways

  • HTML URL Encode
  • What's a URL?
  • How to write a URL:
  • URL Encoding

What’s a URL?

Uniform Resource Locator is what URL stands for. It is a website address. The words (javatpoint.com) or an Internet Protocol (IP) address (195.201.68.81) can be part of a URL. But most people use URLs with words instead of numbers because it’s easier to remember.

How to write a URL:

scheme:/prefix.domain:port/path/filename

Here,

  • The scheme is used to tell what kind of Internet service it is (most common is http or https).
  • the prefix is aย  domain’s name is given by its prefix (default for http is www).
  • The domain is used to describe the name of an Internet site (like javaTpoint.com).
  • Port tells the host what port number to use (default for http is 80).
  • The path is used to tell the server what a path is (If omitted: the root directory of the site).
  • The name of a document or resource is set by its filename.

Here is a list of some of the most common URL schemes:

  • http: Common web pages that use the HyperText Transfer Protocol. Not a secret.
  • https (Secure HyperText Transfer Protocol):Secure web pages. Encrypted.
  • File Transfer Protocol, or ftp, is a way to download or upload files.
  • file: A file on your computer.

 

URL Encoding

URL encoding is used to turn non-ASCII characters into a format that can be used over the Internet, since a URL is only sent over the Internet using the ASCII character set. If a URL contains characters outside the ASCII set, the URL has to be converted.

  • In URL encoding, the non-ASCII characters are replaced with a “%” followed by hexadecimal digits.
  • URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign, or %20.

 

Following is a list of some character sets which are encoded by browser after submitting the text.

Character From Windows-1252 From UTF-8
โ‚ฌ %80 %E2%82%AC
ยฃ %A3 %C2%A3
ยฉ %A9 %C2%A9
ยฎ %AE %C2%AE
ร€ %C0 %C3%80
ร %C1 %C3%81
ร‚ %C2 %C3%82
รƒ %C3 %C3%83
ร„ %C4 %C3%84
ร… %C5 %C3%85
P
php Guru
PHP Developer & Technical Writer โ€” phponline.in A seasoned PHP developer with 8+ years of experience in Laravel, MySQL, and REST APIs. Writes practical tutorials and career guides to help developers grow their skills and income. All salary data is researched from real job postings and developer surveys.
โ† Previous Post
Charset HTML
Next Post โ†’
XHTML vs HTML