tags:

views:

75

answers:

3

I used the function htmlentities() in my php script, but the server says: "undefined function"

After some searching, I understand that the php installation on my webhost does not include that function, and that I can add the function by changing the php.ini file, but I have spent many hours searching, and have not found any information on how to actually do this.

Any suggestions?

+1  A: 

I don't see anything in the manual that says this function is in an optional module that you'd have enable - you just need PHP 4 or 5. Are you sure you're calling the right function?

Adam Wright
It could be disabled via `php.ini`'s `disable_functions` setting, but why is beyond me...
ceejayoz
+5  A: 

If your webhost's PHP install doesn't have something so basic as htmlentities(), it's time to get a new webhost. If it's that bizarrely locked down, you're also not likely to be able to tweak php.ini...

ceejayoz
i could even understand locked down, but missing such a simple function is just plain bizarre! +1 for new webhost! 8)
jcinacio
A: 

It's surprising that this would be unavailable, but have you tried the alternate htmlspecialchars? It will deal with the ones that are most important to deal with.

John Cavan