I am new to php and i have seen rather Ambiguous function name convention in php and this confuses me as i regularly forget function names. I suppose i should give you an example.
If function for encoding is htmlentities then why it’s opposite is named html_entitiy_decode rather than something like entitiesdecode or the one which is more close to htmlentities.
There are matching function names too but i think php does not have a consistent approach to naming its functions.
Any ideas please as it makes hard for me to remember function names. Thanks
No, PHP doesn’t really have a consistent approach to functions names — that’s mainly for two reasons :
Fortunately, the PHP community and developpers are aware of that, and try not to repeat this mistake now, when they develop new functions — but things will most likely remain like this for old functions.
The best you can do is to adopt one naming convention for your classes/functions/methods/variables, and respect it in your projects ; that’ll already be a good start.