EE Version. 2.7.3
I am running rawurlencode on a field in a channel called description to encode it to pass on correctly to twitters sharing url string inside my template.
Example input: Check Out Company Names Latest Post!
so the result should be
Check%20Out%20Company%20Names%20Latest%20Post!
When I echo it outside of the anchor tag it renders correctly with the proper encoding, but as soon as I echo out the variable inside the anchor tag, the %20 encoding is not rendered and regular spaces are in the URL again.
PHP
<?php
$description = rawurlencode('{description}');
?>
Output:
<a href="http://twitter.com/home?status=<?php echo $description; ?> {site_url}" class="popup">
Any ideas what's wrong?