Reputation: 119
<?php
echo "&";
?>
result: &
How do I get php to return & versus &?
I am attempting to update AMP content. The standard what of posting variables is to append them with an ampersand. The AMP arguments include amp_action, amp_ts and amp_url_signature. PHP is removing the amp following the &, so I cannot perform the update.
Some other examples:
<?php
echo "&"."amp_ts";
?>
result: &_ts
<?php
echo "&". "\amp";
?>
result: &\amp
<?php
echo "&\\"."amp";
?>
result: &\amp
Upvotes: 0
Views: 218
Reputation: 67778
It should be echo "&";
just get the ampersand alone ("&") and echo "&amp";
to get "&"
- note the use of the semicolons
Upvotes: 3