A = if infos !empty 和 inputs 为空 - 删除;
B = if infos 为空且inputs !empty - 添加;
C = if infos !empty and inputs !equal to infos - 添加;
我们可以这样:
if B //it's the most common operation, so at the beginning.
{
//add
}
else
{
//remove
}
elseif(c)
{
//the same add
}
我相信这可以是更好的想法。我可以得到你的帮助吗?
提前致谢
最佳答案
if (B || C)
{
//add
}
else
{
//remove
}
关于php - 逻辑编程帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3635089/