realpath 문의
본문
if(function_exists('curl_file_create')) {
$cFile = curl_file_create($path); //원본
}
else
{
$cFile = '@'.realpath($path); //원본
}
위의 소스에서 realpath 앞에 @ 는 왜 붙이는 건가요? 꼭 필요 한 건가요?
답변 2
$cFile = @realpath($path);
는 함수호출시 에러발생할 경우 에러정보를 출력하지 않게하는 구문이지만
$cFile = '@'.realpath($path);
는 '@' 과 함수호출 결과를 단순 스트링으로 이어붙히는 구문입니다.
e.g. "/home/user/foo.txt" > "@/home/user/foo.txt"
!-->!-->Curl 사용 여부를 구분하려고 한 거 같습니다
답변을 작성하시기 전에 로그인 해주세요.