i want to pass value that contain question mark

i have 2 php example example1.php and example2.php

in my example1.php the code like this

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

in my example2.php the code like this

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

 ?>

but in example2.php the title become like this what is this the question mark disappear

i already try to use str_replace my question mark become like this what is this"?" but still same at example2.php the question mark disappear

please help me how to pass value that contain question mark

thanks

有帮助吗?

解决方案

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

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

then add

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

 ?>

this will work for you.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top