예제 #1
0
/**
 * Print with if:
 *  Without it:
 *      1.if($if){
 *            newLine($do);
 *        }else{
 *            newLine($else);
 *        }
 * _______
 *      2.if($if){
 *            newLine("YES");
 *        }else{
 *            newLine("NO");
 *        }
 * ___________________________________________
 *  With this function:
 *      1.ifPrint($if,$do,$else);
 * _______
 *      2.ifPrint($if);
 * @param $if
 * @param string $do
 * @param string $else
 */
function ifPrint($if, $do = "YES", $else = "NO")
{
    if ($if) {
        newLine($do);
    } elseif ($else !== FALSE) {
        newLine($else);
    }
}
예제 #2
0
 public function index()
 {
     readByLine($this->input, function ($line, $id, $lines) {
         newLine($line);
     });
 }