Вопрос по php – Передача & в строке запроса

3

Error: User Rate Limit Exceeded

$abc="A & B";
$abc2=urlencode($abc);

Error: User Rate Limit Exceeded

<a href="hello.php?say=<?php echo $abc2 ?>"><?php echo $abc;?></a>

Error: User Rate Limit Exceeded

$abc=$_GET['say'];
$abcd=urldecode($abc');
echo $abcd;

Error: User Rate Limit ExceededA & B

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded$_GET['say'] without urldecode()Error: User Rate Limit Exceededhttp_buil_query()Error: User Rate Limit Exceeded Mārtiņš Briedis
Error: User Rate Limit Exceeded SuperNoob

Ваш Ответ

4   ответа
2

$url = '?' . http_build_query(array(
  'say' => 'A & B'
));

// Then just:
echo $_GET['say'];

-1

&amp;.

$abc = "A & B";
<a href="hello.php?say=<?php echo htmlentities($abc); ?>"><?php echo $abc; ?></a>
Error: User Rate Limit ExceededshouldError: User Rate Limit Exceeded
&nbsp;Error: User Rate Limit Exceeded&amp;Error: User Rate Limit Exceededurlencode()Error: User Rate Limit Exceededhtmlentities().
Error: User Rate Limit Exceeded
0

$abc = $_GET['say'];
$abcd = urldecode($abc);
echo $abcd;
2

$a = 'A & B';
echo urlencode($a);
echo '<br />';
echo urldecode(urlencode($a));

A+%26+B
A & B

Похожие вопросы