Wrong parameter count for utf8_encode()

Discussion in 'PHP' started by squishi, Dec 22, 2008.

  1. #1
    I get this php error when I run utf8_encode on a string:

    I don't get it. utf8_encode has only one possible parameter (a string)!

    It seems the code is still executed, though. So when I put an "@" in front of the line, the error disappears and the function works.
    I am still curious why I get this error, though. :confused:
     
    squishi, Dec 22, 2008 IP
  2. farad

    farad Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    As I understand, you need to specify a string or it will not work ( in this case - error ) ..

    Btw, can you paste some part of your code ? :rolleyes:
     
    farad, Dec 22, 2008 IP
  3. squishi

    squishi Peon

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I have to correct myself. The function did not work.
    The code is something like:
    $string = utf8_encode(dostuff(utf8_encode($otherstring)));

    The function "dostuff" returns a string, so I don't know why I get the error.

    EDIT: Okay, I got it. It was a bracket in the wrong place. doh!
     
    squishi, Dec 22, 2008 IP