- Code: Select all
$arr1 = array(“al”,”na”,”cl”,”pb”);
$bol_al = “abcd”;
$bol_na = “fghhd”;
$bol_cl = “fghdfg56”;
foreach($arr1 as $k => $v) {
$ddd = $bol_$v //don’t work
}
I want pass to variable $ddd the value of $bol_...
How can I do that?
Moderators: macek, egami, gesf
$arr1 = array(“al”,”na”,”cl”,”pb”);
$bol_al = “abcd”;
$bol_na = “fghhd”;
$bol_cl = “fghdfg56”;
foreach($arr1 as $k => $v) {
$ddd = $bol_$v //don’t work
}


Users browsing this forum: No registered users and 1 guest