You used html_entities, but the function is actually called htmlentities (no _ )