Suchy Posted January 31, 2008 Share Posted January 31, 2008 <select name="id"> <?php foreach($results as $x) { ?> <option value="<?= $x['id'] ?>"> <? printf ("%.40s", $x['name']) // limit name to 40 letters ?> *** id: <?= $x['id'] ?> *** added: <? printf ("%.16s", $x['date']) ?> </option> <?php } ?> </select> here is how it looks: Is it possible to line up the results so the dropdown will look like this: ??? Link to comment https://forums.phpfreaks.com/topic/88665-dropdown-menu-format/ Share on other sites More sharing options...
AndyB Posted January 31, 2008 Share Posted January 31, 2008 http://ca.php.net/manual/en/function.str-pad.php Probably the function you need to use on the name before concatenating it into the option string Link to comment https://forums.phpfreaks.com/topic/88665-dropdown-menu-format/#findComment-454142 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.