I have limited PHP knowledge, and I currently have this:
$Name= simple_fields_values('Name');
$Description= simple_fields_values('Description');
$Price= simple_fields_values('Price');
foreach ($Name as $key_name => $key_value) {
print $key_value ;
}
foreach ($Description as $key_name => $key_value) {
print $key_value ;
}
foreach ($Price as $key_name => $key_value) {
print $key_value;
}
And i Just wanted to know if i can combine this into 1 foreach loop…im sure there is a way, i just dont have the knowledge!
Thanks!
You can merge all these three arrays using
array_merge
and then you can use the merged array in a singleforeach
loop.For eg.,