} // is this a cancelation from the buyer? if ('no' == strtolower(substr($messageBody, 0, 2))) { $mm->setSendMessage($receivedFrom, "Monster Monday is off. {$theBuyer['name']} has declined. Well, this sucks."); $mm->setWeekStatus(FALSE); // mark this week as a fail $mm->logMessage('localhost', "Monster Monday is off. {$theBuyer['name']} has declined. Well, this sucks."); header($_SERVER['SERVER_PROTOCOL'] . ' OK', true, 200); exit; } } } // end confirmation checks // Does this message start with "List" if ('list' == strtolower(substr($messageBody, 0, 4))) { $list = $mm->getShoppingList(); //interesting use of native PHP functions $list = http_build_query($list, NULL, ",\n"); $mm->setSendMessage($receivedFrom, $list); header($_SERVER['SERVER_PROTOCOL'] . ' OK', true, 200); exit; } // Does this message start with "Next" if ('next' == strtolower(substr($messageBody, 0, 4))) { $found = $mm->getWeekBuyer(); $mm->setSendMessage($receivedFrom, "{$found['name']} is on Monster Monday duty for " . date('l, F jS', $found['weekOf'])); header($_SERVER['SERVER_PROTOCOL'] . ' OK', true, 200); exit; } // Brodcast, send to all expect the sender if ('broadcast' == strtolower(substr($messageBody, 0, 9))) {