Jump to content

rbaez

New Members
  • Posts

    4
  • Joined

  • Last visited

rbaez's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey man thank you very much, i solve my problem . foreach ($params->new_occ as $room => $occupants) { $myroom = $room + 1; $adults = (isset($occupants["adults"]) ? $occupants["adults"] : 0); $children = (isset($occupants["children"]) ? sizeof($occupants["children"]) : 0); $new_room_occ .= ' <tr> <td>'.$myroom.'</td> <td class="tc">'.$adults.'</td> <td>'.$children.'</td> </tr> '; } Thanks.
  2. What i need to print is something like this: $new_room_occ .= ' <tr> <td>'.$room.'</td> # if its room 1 or room 2 or room 3 <td class="tc">'.$adults.'</td> # adult number <td>'.$children.'</td> # children number </tr> '; Best Regards.
  3. Thanks dude, this really help me a lot. Just one more thing, how can i make than instead of room 0, room 1 and room 2 says room 1, room 2, room 3 Best Regards.
  4. Hello guys i want to know how can i iterate this array. stdClass Object ( [new_occ] => Array ( [0] => Array # This is the room number ( [adults] => 2 [children] => Array ( [0] => 0 [1] => 0 [2] => 0 ) ) [1] => Array ( [adults] => 1 ) [2] => Array ( [adults] => 2 [children] => Array ( [0] => 1 [1] => 1 [2] => 1 ) ) ) ) i want to print each of the elements but for adults and children, i only want the sum of the elements for each room. Thanks in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.