Can I write variables directly or write true in the brackets after if? Please give me some advice. What will be the result if I write these two? -PHP Chinese website Q&A - Can I write variables directly or write true in the brackets after if? Please give me some advice. What will be the consequences if I write these two? -PHP Chinese website Q&A
Can I write variables directly or write true in the brackets after if? Please give me some advice. What will be the result if I write these two? -PHP Chinese website Q&A - Can I write variables directly or write true in the brackets after if? Please give me some advice. What will be the consequences if I write these two? -PHP Chinese website Q&A
Please watch and learn.
因为if后面的判断语句就是要判断执行if还是else后面的语句,如果你直接写if(true)的话,if后面永远是true,也就是说无论前面如何改变,都永远执行if里面的语句,不会执行else里面的语句。