file_put_contents() 함수 > 개발자팁

개발자팁

개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.

file_put_contents() 함수 정보

JavaScript file_put_contents() 함수

본문

PHP버전이 낮아서 file_put_contents() 함수가 없는것으로 나올 때 쓰시면 됩니다.

if (function_exists("file_put_contents") == false) {
  function file_put_contents($n, $d)
 {
  $f = @fopen($n, "w");
  if (!$f) {
   return false;
  }
  else {
   fwrite($f, $d);
   fclose($f);
   return true;
  }
 }
}

[이 게시물은 관리자님에 의해 2011-10-31 17:12:10 PHP & HTML에서 이동 됨]
추천
0
  • 복사

댓글 1개

© SIRSOFT
현재 페이지 제일 처음으로