I need some help with basic syntax in PHP,
I got the following string :
$str = "return (strlen(replace) <= 5 && strlen(replace) >= 1);";
and I got a variable : $var = "VariableValue";
and the st_replace function as : str_replace('replace', $var, $str);
What I am trying to do is actually use eval in somehing like:
if(eval($str)){//This should now make the if condition **look like**
//if(strlen(*'VariableValue'*)...)
//
echo 'Success';
}else{
echo 'Ask the guys at StackOverFlow :),sure after searching for it';
}
So if you notice what is if(strlen('VariableValue')...) this is what I want to do,make the final if statement after eval containing the vars value WITH QUOTES so strlen actually process it,
I hope I made clear as needed :)
Thanks in advance