如何在不用空格替换+号的情况下从URL获取值?
URL:https://example.com/platform?id=xxtMEzBG56F3Z2Z+w1VT+g==
当前,当我尝试通过$_GET['id']
在PHP中获取变量时,它会自动将+
替换为space
。我如何在这里获得真正的价值?
我得到的价值是xxtMEzBG56F3Z2Z w1VT g==
,我想要的是xxtMEzBG56F3Z2Z+w1VT+g==
答案 0 :(得分:0)
您可以将declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare namespace tei = "http://example.com/tei";
declare namespace exist = "http://example.com/exist";
declare option output:method 'html';
let $text :=
<tei:text>
<tei:front>
<tei:div>
<tei:listBibl>
<tei:bibl>There is some</tei:bibl>
<tei:bibl>text in certain elements</tei:bibl>
</tei:listBibl>
</tei:div>
<tei:div>
<tei:listBibl>
<tei:bibl>which are subject <exist:match>to</exist:match> a Lucene search</tei:bibl>
<tei:bibl></tei:bibl>
</tei:listBibl>
</tei:div>
</tei:front>
<tei:body>
<tei:p>and often produces</tei:p>
<tei:p>a hit.</tei:p>
</tei:body>
</tei:text>
,
$match := $text//exist:match,
$text-before-all := normalize-space(string-join($match/preceding::text(), ' ')),
$text-before := substring($text-before-all, string-length($text-before-all) - 30),
$text-after := substring(normalize-space(string-join($match/following::text(), ' ')), 1, 30)
return
<td>...{$text-before}
<span class="search-hit">
{$match/text()}
</span> {$text-after}...</td>
与$_SERVER
一起使用
QUERY_STRING