php - Get the ids and loop through post data -
i post form same input names+id @ end that:
<input type="text" name="machine_1"> <input type="text" name="machine_11"> <input type="text" name="machine_23">
how loop through on each of them , id's in loop?
i tried way, loop lot without data , happens if there more thank 100 id?
for($i=0; $i<100; $i++){ $_post["machine"]=$_post["machine_".$i]; $id=$i; }
post
associate array, can loop through that's been posted this:
//$k contains id //$v contains submitted value foreach($_post $k => $v) { //test if id contains 'machine' if(stristr($k, 'machine')) { echo $v; } }
Comments
Post a Comment