I’m using WP-property (a wordpress plugin) and am trying to use a variable as link in a template. I’m using the following code:
<a href="<?php echo $property['download1link']; ?>" target="_blank"><?php echo $property['download1tekst']; ?></a>
However, the link doesn’t work as the ‘-‘ is different. How can I fix this (/replace the – with a normal -)?
Output now (ndash):
http://ouwejan.hostbeats.com/wp%E2%80%93content/uploads/2012/07/NVM_Goed%E2%80%93gevoel%E2%80%93NVM_Label_fc11.jpg
Output as it should be:
http://ouwejan.hostbeats.com/wp-content/uploads/2012/07/NVM_Goed-gevoel-NVM_Label_fc11.jpg
Thanks.
See
str_replace()
:http://php.net/str_replace
Example:
Or, for more advanced replacements,
preg_replace()
:http://php.net/manual/en/function.preg-replace.php
First go to this page:
http://slayeroffice.com/tools/ascii/
to find the ascii number of the bad “-“.
You just paste your “â” in the left box on top of the page and you click the [==] button
I think it is 8211, then you do: