从php中的逻辑表达式中提取元素 [英] Extract element from a logical expression in php
本文介绍了从php中的逻辑表达式中提取元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
给定一个逻辑表达式(例如。((A AND B)OR C)),如何在php中提取像A,B,C这样的单个元素。逻辑表达式可以是任何东西,包括AND,OR和BRACKETS。
先谢谢。
解决方案
试试这个,你应该可以改进它。
if (!empty(
_POST)){
// 要删除的字词列表
keywords = array(' IF',' 那么',' ELSE',' ENDIF', ' AND',' OR',' XOR','跨度> <温泉n class =code-string>&&',' &',' IS',' < span class =code-string> NOT',' WHERE');
// 用户输入的表达式。
Given a logical expression ( for eg. ((A AND B) OR C) ) , How can one extract individual elements like A, B, C in php. The logical expression can be anything , comprised of AND, OR and BRACKETS.
Thanks in advance.
解决方案
Try this, you should be able to improve on it.
if (!empty(
_POST)) { //The list of words to remove
keywords = array( 'IF', 'THEN', 'ELSE', 'ENDIF', 'AND', 'OR', 'XOR', '&&', '&', 'IS', 'NOT', 'WHERE' ); //The expression the user entered.
这篇关于从php中的逻辑表达式中提取元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文