I am new to the world of coding as well as PHP and XHTML. I was just going through the details of meta tags and do not understand the property http-equiv nor what is the charset used for as well as what the value UTF-8 refers to e.g. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />.
I am new to the world of coding as well as PHP and XHTML.
Share
There’s a really good article by Joel Spolsky that discusses charsets. Take a look:
The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
As for HTTP headers, a quick Google search for “understanding HTTP headers” turned up quite a few good articles that describe them. Here’s one: HTTP Headers for Dummies.
In short, HTTP headers are basically small messages that get sent to the user’s web browser that tell the browser about the output it’s going to receive (ie, is it a web page, a file, an image; should it be cached; etc), or for things like cookies that should be saved by the client’s browser.
HTTP headers are also sent from the user’s web browser back to the server. The most obvious example are again, cookies – every cookie that is saved by the browser is supposed to be sent back to the server on each HTTP request.
In your case, you’re probably talking about a specific HTTP header that defines the character set for the page. The
<meta http-equiv="">tags are used to simulate HTTP headers.For example, if you had a static HTML page and wanted to take advantage of a particular HTTP header, but couldn’t configure it in the web server, you could use a
<meta http-equiv="">tag to achieve the same result.