I’m working with a while loop and I need to be able to assign the value of a variable to the name of a new variable. Here is the loop ($slide_number always returns a number):
$slide_number = theme_get_setting('slides_number');
$count = '1';
while ($count <= $slide_number) {
$slide_path = theme_get_setting('slide_path_'.$count.'');
if (file_uri_scheme($slide_path) == 'public') {
$slide_path = file_uri_target($slide_path);
}
$count++;
}
So let’s say $slide_number is 2. I need to produce $slide_path_1 and $slide_path_2, so how do I add the $count variable to $slide_path to create $slide_path_1 and $slide_path_2?
Refer with: