Please Log in to join the conversation.
Please Log in to join the conversation.
$adult = 0;
$price = 0;
foreach ( json_decode( '[cb_familymembers]', true ) as $child ) {
if ( $child['cb_familymembers_adultvisitor'] == 'Adult' ) {
$adult++;
}
}
if ( $adult ) {
$price += ( $adult * 10 );
}
return $price;
Please Log in to join the conversation.
Please Log in to join the conversation.
array(2) { ["cb_adultvisitor"]=> string(5) "Adult" ["cb_familymembername"]=> string(3) "Bob" } array(2) { ["cb_adultvisitor"]=> string(5) "Adult" ["cb_familymembername"]=> string(6) "Sharon" } array(2) { ["cb_adultvisitor"]=> string(5) "Child" ["cb_familymembername"]=> string(7) "Michael" }
Please Log in to join the conversation.
$adult = 0;
$price = 0;
foreach ( json_decode( '[cb_familymembers]', true ) as $child ) {
if ( $child['cb_adultvisitor'] == "Adult" ) {
$adult++;
}
}
return $adult;
Please Log in to join the conversation.