$img_path = "/home/www/test.png"; // image path
$args[basename($img_path)] = '@' . realpath($img_path);'@' . realpath($img_path);这句代码执行后应该是什么结果。
'@' .是什么作用。
$args[basename($img_path)] = '@' . realpath($img_path);'@' . realpath($img_path);这句代码执行后应该是什么结果。
'@' .是什么作用。
这时候的@是用来屏蔽function的出错信息。
为什么要加引号呢?可不可以这样写: @realpath($img_path);求解
$args[basename($img_path)] = '@' . realpath($img_path);
basename函数返回$img_path的文件名test.png;
realpath函数返回规范化的绝对路径名;
这段代码的意思是数组$args中key为test.png的value为一个字符串,这个字符串是"@"连接$img_path的绝对路径名,如果想用@抑制错误输出的话应该是这样用@realpath($img_path);
Signature-------------------------------------------------------------------------------------We are what we repeatedly do. Excellence, therefore, is not an act, but a habit ugg boots ugg Classic Mini ugg classic tall ugg classic cardy ugg classic short