function confirm($msg, $expert='yes|y') {
	$input = propmt($msg);
	return in_array(trim($input), explode('|',$expert));
}

function propmt($msg) {
	echo $msg;
	$handle = fopen("php://stdin","r");
	return fgets($handle);
}

if ( confirm('are you sure? (yes/no)') ) {
    echo 'delete!';
}