array_push($participants, $newpart); } while ($check != 'yes'); echo "\nAdd more participants yes/no >"; $addmore = trim(fgets(STDIN)); } while ($check != 'yes'); echo "\nEnter the group name > "; $groupname = trim(fgets(STDIN)); do { echo "\nIs it right yes/no > "; $check = trim(fgets(STDIN)); if ($check != 'yes') { echo "\nEnter the group name > "; $groupname = trim(fgets(STDIN)); } } while ($check != 'yes'); $w->sendGroupsChatCreate($groupname, $participants); break; case '/chat': echo "\nEnter the name of the contact > "; $nickname = trim(fgets(STDIN)); do { echo "\nIs it right yes/no > "; $check = trim(fgets(STDIN)); if ($check != 'yes') { echo "\nEnter the number you want to add > "; $nickname = trim(fgets(STDIN)); } } while ($check != 'yes'); echo "\n\n"; echo "You are chatting with {$nickname}\n"; echo "=================================\n\n";