assign variables in php with for loop
for($i = 0; $i <= 7; $i++) {
$name = "variable{$i}";
$$name = "foo";
}
or
for($i = 0; $i <= 7; $i++) { ${"variable$i"} = "foo"; }
or
${"jassi"} .= $_POST['skip'.$daynum];
We provide knowledgeable blogs related to php, jQuery, html, css, wordpress, woocommerce, cordova app with examples in 2021.
assign variables in php with for loop
for($i = 0; $i <= 7; $i++) {
$name = "variable{$i}";
$$name = "foo";
}
or
for($i = 0; $i <= 7; $i++) { ${"variable$i"} = "foo"; }
or
${"jassi"} .= $_POST['skip'.$daynum];
Comments
Post a Comment