What are the measures needed to prevent or to stop JavaScript injections from happening in a PHP Web application so that sensitive information is not given out (best-practic
This question already have some answers accepted and rated by users.
Instead I am also posting an answer, hope this will work fine.
This is tested by me.
$value = preg_replace("/[\'\")(;|`,<>]/", "", $value);
preg_replace() function works perfectly here.