code_junkie

PHP: Right way to declare variable before use in loop

Nov 11th, 2011
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.12 KB | None | 0 0
  1. $str = "";
  2. for($i = 0; $i < 10; $i++) $str .= "something";
  3.  
  4. for($i = 0, $str = ''; $i < 10; $i++) $str .= "something";
Add Comment
Please, Sign In to add comment