Welcome Guest, Not a member yet? Register   Sign In
Escapting String for Eval

Assume I have a function that accepts one string argument:

function foo($bar)

Assume also that I will execute this function via Eval:


As suggested by the above snippet, the value for the argument will come from form input.

QUESTION: how do I prepare the form input so that it doesn't cause an problems when it is passed to the function inside the eval? "addslashes" doesn't seem to be sufficient; I still get failures if I try to enter something with a double quote (and probably a few other characters).

The string argument is to be stored in an object, then later stored in MySQL.

Did you try:

In your eval thing

Would that work?

I want a non-CI approach to this. This is for a library I am developing, which I do not want to couple to CI.

Theme © iAndrew 2016 - Forum software by © MyBB