Strange Characters in My Data

Discussion in 'PHP' started by rederick, Sep 7, 2007.

  1. #1
    Hello,

    I've got some data that I pull from someone else's database. The data ends up coming out with some characters like this. ’ I am not sure the root cause of the issue - but I was attempting to just hack out the issue on the display side of things - however ... I couldn't seem to match that character using PHP

    Itried using:

    $remarks = "preserve this home’s original character";
    $remarks = str_replace("’","'",$remarks);

    also
    $remarks = preg_replace("/’/","'",$remarks);

    However, these do not seem to match that character. Has anyone had this issue with that character - is there a fix for it?

    Thank you,
    Aaron
     
    rederick, Sep 7, 2007 IP
  2. rederick

    rederick Peon

    Messages:
    128
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mnm - I might have posted this issue to early in my investigation.
    There must be something I am missing - It seems to work when I just put that character in a string and replace it out. The browser must be doing some translation - I will need to look into the raw data file to see what the exact character looks like.
     
    rederick, Sep 7, 2007 IP
  3. k2pi

    k2pi Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    maybe you can try to encode these characters in html codes to cath it with php
     
    k2pi, Sep 9, 2007 IP