[ create a new paste ] login | about

Link: http://codepad.org/fIUaj7eb    [ raw code | output | fork ]

PHP, pasted on Jun 27:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?

	$values = array(array("name" => "Floris",
						  "id"   => "u1"),
					array("name" => "Rosa",
						  "id"   => "u2"),
					array("name" => "Lotte",
						  "id"   => "u3"));
	
	foreach ($values as $value) {
		
		echo '<input type="checkbox" name="inuser[' . $value['id'] . ']" id="' . $value['id'] . '" value="' . $value['name'] . '" /><label for="' . $value['id'] . '">' . $value['name'] . "</label>\n";
	}


Output:
1
2
3
<input type="checkbox" name="inuser[u1]" id="u1" value="Floris" /><label for="u1">Floris</label>
<input type="checkbox" name="inuser[u2]" id="u2" value="Rosa" /><label for="u2">Rosa</label>
<input type="checkbox" name="inuser[u3]" id="u3" value="Lotte" /><label for="u3">Lotte</label>


Create a new paste based on this one


Comments: