PHP security is something you have to take very serious because every site will suffer damages if a hacker finds vulnerabilities in the php code.
With the php secure code below you can protect your php project from SQL injections and XSS.
Basically, this function will clean your variable, starting with ereg_replace function which will replace ‘, “, < and > with empty space “”.
htmlentities will transform html tags into entities, something like: <b> tag will become & lt;b& gt;
How to use the php security function?
If you have a variable you must secure just call this function like this – secure($variable);
No related php tutorials.