php - Generate an incremental $variable when in a for loop -


this question has answer here:

i'd increment variable within loop "$filename" turns "$filename1" , $filename2"?

$filename = false; $filename1 = false; $filename2 = false;      ($i = null; $i <=2; $i++){   $filename = $this->blabla; } 

use variable variables:

${"filename".$i} = $this->blabla; 

documentation


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

mysqli - Php Mysqli_fetch_assoc Error : "Warning: Illegal string offset 'name' in" -

c - "error: subscripted value is neither array nor pointer nor vector", but why? -