Martholomew
Martholomew

Reputation: 89

adding a function to php.ini

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?

Upvotes: 0

Views: 354

Answers (3)

Adam Wright
Adam Wright

Reputation: 49386

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?

Upvotes: 1

Joanne C
Joanne C

Reputation: 1115

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.

Upvotes: 0

ceejayoz
ceejayoz

Reputation: 180065

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...

Upvotes: 5

Related Questions