• PHP Help General Help
  • [RESOLVED] The function exists but I still get "call to undefined function" error

Hi

I downloaded from PHPclasses.com a class which converts charset.

This is the class.

However, whenever I try to call the ConvertCharset::Convert function I get
This error "Call to undefined function: makeconverttable()".
I checked it and this function exists!

What can I do?

Thanks.

    Make sure the Convert() method calls the "undefined" function with the correct spelling, including any capitalization. If that's not the problem, then I wouldn't have any idea without seeing the code (and I'm too lazy to register on that site, then download the code, yadda yadda yadda... 😉 ).

      I don't think you'll be able to call it using the "::" operator, as the Convert() method calls the MakeConvertTable() method via "$this->", rather than "self::". Therefore, you need to instaniate an object and then call the Convert() method via that object and the "->" operator:

      $cc = new ConvertCharset();
      $cc->Convert($arg1, $arg2, $arg3);
      

        indeed. You are accessing a method statically when the Convert() method uses other methods in an instance context.

        What NogDog suggested is correct.

          Write a Reply...