逻辑编程帮助

MEM*_*MEM 2 php logic

A =如果infos!为空并且输入为- 请删除;

B =如果infos为空并且输入!为空 - 请添加;

C = if infos!empty和inputs!等于infos - do add;

我们可以喜欢:

if B //it's the most common operation, so at the beginning.
{
  //add 
}
else
{
 //remove
}
elseif(c) 
{
 //the same add
} 
Run Code Online (Sandbox Code Playgroud)

我相信这可以更好地思考.我可以帮忙吗?

提前致谢,

Dez*_*igo 8

if (B || C) 
{
  //add 
}
else
{
 //remove
}
Run Code Online (Sandbox Code Playgroud)