php使用空格从URL动态填充变量或<select>标记

On a page, I have an HTML form with a <select> tag. This is dynamically filled with php... using content with spaces.

<select text="52 state street" value="53 state street">

On another page, I create the links to it.

<a href="example.com/page/?var=53%20state%20street">

Is there something I can replace the %20's with that will fix this issue?

Note Using WordPress and a plugin called "gravity forms". ?var dynamically selects an option through the plugin I am using in WordPress. I don't think my issue is with WordPress or the plugin, but rather a lack of php knowledge. I don't have access to the html form code aside from filling it with variables (it is called in via shortcode).

You can try the urldecode function. http://php.net/manual/en/function.urldecode.php

you can also use trim function like this

<?php $str = "Hello World!"; echo $str . "<br>"; echo trim($str," "); ?>

Output like this HelloWorld