在我用PHP开发的这些年里,我总是听说使用eval()是邪恶的.
考虑以下代码,使用第二个(更优雅)选项是否有意义?如果没有,为什么?
// $type is the result of an SQL statement
// e.g. SHOW COLUMNS FROM a_table LIKE 'a_column';
// hence you can be pretty sure about the consistency
// of your string
$type = "enum('a','b','c')";
// possibility one
$type_1 = preg_replace('#^enum\s*\(\s*\'|\'\s*\)\s*$#', '', $type);
$result = preg_split('#\'\s*,\s*\'#', $type_1);
// possibility two
eval('$result = '.preg_replace('#^enum#','array', $type).';');
Run Code Online (Sandbox Code Playgroud) 我需要通过命令行发送电子邮件,而无需任何人工交互以实现自动化.
我知道我们可以使用mailto命令,但这会组成电子邮件,主题,正文和所有内容,但除非我点击发送,否则它不会发送它.
我在线阅读我们可以使用blat但我不能使用除outlook之外的任何东西.
这是关闭后我发现链接到SOF帖子.
只是为了您的信息:我正在研究一些telnet命令发送电子邮件还没有成功. telnet用于发送电子邮件的命令