I and lately I\'m seeing h()
and e()
functions in PHP. I have googled them, but they are so short that results don\'t give any idea of what they are. I
I'd guess that h()
escapes user-submitted data for safe output, and e()
escapes for database insertion. Whatever the functionality, these are not stock PHP functions.
In CakePHP h() is: Convenience wrapper for htmlspecialchars()
For more information about Global constants and functions in CakePHP view this link
http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html
Most likely, they are dummy functions someone introduced for the sake of brevity. The h(), for example, looks like an alias for htmlspecialchars():
function h($s)
{
return htmlspecialchars($s);
}
So look for them in the include files. Espec. the ones with names likes "util.php" or "lib.php".
It looks like it might be CakePHP.
See e()
e (mixed $data)
Convenience wrapper for echo().
This has been Deprecated and will be removed in 2.0 version. Use echo() instead.
See h()
h (string $text, string $charset = null)
Convenience wrapper for htmlspecialchars().
There aren't any functions in PHP called h() and e(). They must be declared in the project you are working on. search for them and find out what they do.
It's CakePHP.
echo h('some stuff')
Is just htmlspecialchar()
ing the stuff.