Posts by Roberto Henriques • 25 points
2 posts
-
0
votes1
answer60
viewsQ: Problem with foreach() printing twice
I have the following code: $ms = [8,12,13]; // $ms = json_decode($ar,true); // sobrou da versão anterior da pergunta for($i=1; $i<21; $i++) { foreach($ms as $obj){ if( $i == $obj ) { echo $obj; }…
phpasked Roberto Henriques 25 -
-4
votes1
answer345
viewsQ: Mark checkboxes as indicated on a JSON
I have a table with two rows and three columns all with a checkbox set. The idea is to mark as checked through a json string var rs = [{"cklist":"1;1;1"},{"cklist":"0;0;0"}]; whereas the cklist[0]…