mercredi 20 avril 2016

How can we parse a string condition to use in if statement

Hi I have a string variable (which I'm getting from some other source) as "$abc=='xyz' AND $yza == 'lmn'".. and so on. Is there any way I can put this whole string in IF statement to test the condition. like

$condition = "$abc=='xyz' AND $yza == 'lmn'"; 
  if($condition)
   //do something..
  else
   //do something...

Thanks.

Aucun commentaire:

Enregistrer un commentaire