Here is the code:
<?php
$text = "your€text ‘ go ’ es “ here aa ” aaaa•";
$variables = array( "£" => "£",
"€" => "&euro",
"‘" =>"'",
"’" =>"'",
"“" =>"\"",
"”" =>"\"",
"'" =>"&bull"
);
while( list( $key, $value ) = each( $variables ) )
{
$text = str_replace( $key , $value, $text );
}
echo $text;
?>
The problem is that it will only replace the euro symbol and the bullet if there is no spaces. Like this:
text•text
In that situation it will replace it but when it's like this:
text • text
it won't work. Any ideas?