PHPize Online / SQLize Online

A A A
Share   Donate   Blog   Popular
Copy Format Clear
Copy
Copy Format Clear
<?php $arr = [ 'name' => [ 'family' => 'family', 'friends' => 'friends' ], 'color' => [ 'red' => 'red', 'blue' => 'blue' ] ]; // convert array to apopriate form $res = array_combine( array_values($arr['name']), array_values($arr['color']), ); print_r($res); foreach($res as $name=>$color) { printf('<option name="chapter" style="color:%s" class="user-chapters" >%s</option>'.PHP_EOL, $color, $name); }
Show:  
Copy