示例代码 <?php echo "please enter your text and give only a 'q' when you want to quit\n"; while (($answer = getEnter()) != 'q') { echo