<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Reference Book Blog &#187; urldecode</title>
	<atom:link href="http://www.phpreferencebook.com/tag/urldecode/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpreferencebook.com</link>
	<description>PHP Reference: Beginner to Intermediate PHP5</description>
	<lastBuildDate>Wed, 25 Aug 2010 12:58:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Display a Query String Value on a Web Page</title>
		<link>http://www.phpreferencebook.com/tips/display-query-string/</link>
		<comments>http://www.phpreferencebook.com/tips/display-query-string/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 05:15:23 +0000</pubDate>
		<dc:creator>Mario Lurig</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[$_GET]]></category>
		<category><![CDATA[$_SERVER]]></category>
		<category><![CDATA[query string]]></category>
		<category><![CDATA[urldecode]]></category>

		<guid isPermaLink="false">http://www.phpreferencebook.com/?p=57</guid>
		<description><![CDATA[It seems simple, almost basic, but many people want to display the contents of a query string on a page for the user or just for troubleshooting purposes. Everyone does it, everyone needs to do it, and there are a few different options I&#8217;m going to introduce below. First, our sample URL: http://www.phpreferencebook.com/?variable=value&#038;name=Mario%20Lurig&#038;gender=male%21 or http://www.phpreferencebook.com/?variable=value&#038;name=Mario [...]]]></description>
			<content:encoded><![CDATA[<p>It seems simple, almost basic, but many people want to display the contents of a query string on a page for the user or just for troubleshooting purposes. Everyone does it, everyone needs to do it, and there are a few different options I&#8217;m going to introduce below. First, our sample URL:</p>
<pre>http://www.phpreferencebook.com/?variable=value&#038;name=Mario%20Lurig&#038;gender=male%21</pre>
<p> or</p>
<pre>http://www.phpreferencebook.com/?variable=value&#038;name=Mario Lurig&#038;gender=male!</pre>
<ol>
<li>Display the whole string (everything after the question mark)</li>
<ul>
<li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'QUERY_STRING'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</li>
<ul>
<li>
<pre>variable=value&#038;name=Mario%20Lurig&#038;gender=male</pre>
</li>
</ul>
</ul>
<li>Display the whole string decoded (convert %## to original characters)</li>
<ul>
<li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">urldecode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'QUERY_STRING'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</li>
<ul>
<li>
<pre>variable=value&#038;name=Mario Lurig&#038;gender=male!</pre>
</li>
</ul>
</ul>
<li>Show each variable and value as an array (already decoded)</li>
<ul>
<li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</li>
<ul>
<li>
<pre>Array ( [variable] => value [name] => Mario Lurig [gender] => male!</pre>
</li>
</ul>
<li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;pre&gt;'</span><span style="color: #339933;">;</span> <span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt; /pre&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</li>
<ul>
<li>
<pre>Array
(
    [variable] => value
    [name] => Mario Lurig
    [gender] => male!
)
</pre>
</li>
</ul>
</ul>
</ol>
<p>There are lots of options from there, so don&#8217;t let this be the end of your exploration of how to display a query string value on a page. If you have any great tricks, feel free to share them in the comments below!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpreferencebook.com/tips/display-query-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
