Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function mostrar($p){
- $tot = count($p);
- for ($i=0; $i<$tot; $i++){
- $tot1 = count($p[$i]);
- echo "<div style='display:flex;'>";
- for($y=0; $y<$tot1;$y++){
- if ($p[$i][$y]==0){
- echo "<div style='width:10px;height:10px;background:#000;'> </div>" ;
- } else {
- echo "<div style='width:10px;height:10px;background:#FFF;'> </div>" ;
- }
- }
- echo "</div>";
- }
- }
- $array = array(
- array(0, 0, 0, 0, 1, 0),
- array(0, 1, 1, 1, 1, 0),
- array(0, 1, 0, 0, 0, 0),
- array(0, 1, 1, 1, 1, 0),
- array(0, 0, 0, 0, 1, 1),
- array(0, 0, 0, 0, 0, 0)
- );
- mostrar($array);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement