2014-03-27 31 views
0

我想通过包含问号php传递值包含问号?

值我有2个PHP的例子example1.php和example2.php

在我example1.php这样

<a href="example2.php?title=what is this?" /> 

代码在我的例题.PHP这样

<php 
if(isset($_GET['title'])) 
{ 
    $title = $_GET['title']; 
    echo $title; 
} 

?> 

但example2.php标题变成了这个样子what is this问号disappe代码AR

我已经尝试使用str_replace我的问号变成了这个样子what is this"?"但仍同在example2.php问号消失

请帮助我如何通过包含问号

感谢

+0

使用:%3F搜索URL编码器。 –

回答

0

变化<a href="example2.php?title=what is this?" />

<a href="example2.php?title=what is this%3F" /> 

再加入

<?php 
if(isset($_GET['title'])) 
{ 
    $title = $_GET['title']; 
    echo $title; 
} 

?> 

这将适用于您。