Guest User

Untitled

a guest
Jan 21st, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <?php
  2. foreach ($attribute_groups as $attribute_group) {
  3. echo $attribute_group['name'];
  4. print_r($attribute_group);
  5. echo '<select name="listaGrupe">';
  6. foreach ($attribute_groups['attribute'] as $attribute) {
  7. echo '<option value="'.$attribute.'">'.$attribute.'</option>';
  8. }
  9. echo '</select>';
  10. }
  11.  
  12. ?>
  13.  
  14. foreach ($attribute_groups as $attribute_group) {
  15. $options = '';
  16. $name = $attribute_group['name'];
  17. $output = '<select name="$name">';
  18. foreach ($attribute_groups['attribute'] as $attribute) {
  19. $options .= '<option value="'.$attribute.'">'.$attribute.'</option>';
  20. }
  21. echo $output.$options.'</select>';
  22. }
  23.  
  24. if(!empty($attribute_groups)){
  25. foreach ($attribute_groups as $attribute_group) {
  26. $options = '';
  27. $name = $attribute_group['name'];
  28. $output = '<select name="$name">';
  29. foreach ($attribute_groups['attribute'] as $attribute) {
  30. $options .= '<option value="'.$attribute.'">'.$attribute.'</option>';
  31. }
  32. echo $output.$options.'</select>';
  33. }
  34. }
Add Comment
Please, Sign In to add comment