For loop with 2D array
Posted: Sat May 19, 2012 12:25 pm
I have an array,
$application_languages = array('en' => 'English', 'el' => 'Greek');
and try to show those in a for loop, I need the 'en', 'el' etc. but will also need 'English', 'Greek' values...
This code will cause errors,
$application_languages = array('en' => 'English', 'el' => 'Greek');
and try to show those in a for loop, I need the 'en', 'el' etc. but will also need 'English', 'Greek' values...
This code will cause errors,
Code: Select all
<?php for($i=0;$i<count($application_languages);$i++) { ?>
<div class="form-line">
<label><?php echo s_title; ?> (<?php echo $application_languages[$i][$i]; ?>)</label>
<input type="text" class="input-text-medium" name="title_<?php echo $application_languages[$i][$i]; ?>" />
</div>
<?php } ?>