PHP bool Expression

Asked

Viewed 229 times

0

I am working on a Boolean expression configured by the application user. This expression comes from the database so it’s a string, I need to make PHP understand it so I have true and false.

Example :

Expressao_string = ”(1 and ( 0 or 1) )”;

Since this string value comes from a base, I need to make this string valid for PHP.

  • In the database it’s like tinyint(1)?

  • If it is coming by 1 and 0, I believe you do not need to do anything. Treat 0 as false and 1 as true.

  • What logical operations will be considered? Only and and or or also the not, xor, etc.?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.