php - Using empty over == "" -


It has come to my attention that by using (empty ($ var)) { It is not as efficient as most people think

instead of using empty () if I am using ($ Var == "") {{/ Code>

Because if the text box / input is a white space, it is not empty .. while using white at white locations using == "" Is not taken care of, so if any white spot and cave If there is a white spot, then my second example is more

for PHP documentation

The following things are considered empty:

  "(an empty string) 0 (0 as an integer) 0.0 (0 as a float)" 0 "(As a string) Null Falls array () (an empty array) $ var; (A variable has been declared, but without any value)    

It seems that you are just checking that there is a non-existent The black color is the character and therefore it should work:

  if (stroken ($ var) == 0)    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -