Skip to main content


This topic contains 4 replies, has 3 voices, and was last updated by  __ 3 years, 12 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #202666


    I’m trying to use this php to replace characters in a text string I’ve taken from a mysql database:

    str_replace(array('“', '”', '’', '®', '—'), array('"', '"', "'", '®', '-'), $row{'description'});

    Instead of seeing the characters I’m trying to use as replacements, I’m just seeing missing character symbols when the page renders in browser.

    If I run that same str_replace code on a string not taken from mysql, it works as expected.

    The “description” field in mysql is set to use character set: utf8

    what am I missing?



    Make sure the PHP file where you use this function is encoded as UTF-8.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

icon-link icon-logo-star icon-search icon-star