我只是想用类似的东西生成一条路径:
$PhotoName = the_title();
$DestinationFile = 'temp/watermarked/';
$DestinationFile .= $PhotoName;
$DestinationFile .= '.jpg';
the_title();是一个获取帖子标题的 Wordpress 函数。如果我echo只是$PhotoName看到帖子的名称是可疑的。但是,如果我echo $DestinationFile它永远不会打印字符串的那一部分,所以我会看到类似的东西temp/watermarked/.jpg,它永远不会$PhotoName作为它的一部分打印。