Does anyone know if question marks are allowed in the text for the Twitter share button?
I have the following code and when I click on the share and the popup button appears, the message stops at "Who's your favorite Candidate". It doesnt read the text past the question mark.
<?php
$text = "Who's your favorite candidate ? This is another message";?>
<a href="https://twitter.com/share?text=<?php echo $text; ?>&url=<?php echo $decoded_url; ?>&hashtags=contesthashtag" class="twitter-share-button" data-lang="<?php echo $lang; ?>" data-hashtags="contesthashtag" data-url="<?php echo $fanpage_url; ?>" data-text="<?php echo $text; ?>">Click here to share on Twitter</a>
You need to urlencode the text before placing it as a link.
<?php
$text = urlencode("Who's your favorite candidate ? This is another message");
?>
Then pass that $text variable through the twitter share button link.