태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

블로그 이미지
좋은 인생이였다. 라고 말 할 수 있는 삶을 살자
희윤

Notice

Recent Comment

Recent Trackback

Archive

calendar

      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      
  • 27,655total
  • 8today
  • 22yesterday
2008/07/01 10:21 php

fwrite

(PHP 3, PHP 4 )

fwrite -- Binary-safe file write

Description

int fwrite ( int fp, string string [, int length])

fwrite() writes the contents of string to the file stream pointed to by fp. If the length argument is given, writing will stop after length bytes have been written or the end of string is reached, whichever comes first.

fwrite() returns the number of bytes written, or -1 on error.

Note that if the length argument is given, then the magic_quotes_runtime configuration option will be ignored and no slashes will be stripped from string.

Note: On systems which differentiate between binary and text files (i.e. Windows) the file must be opened with 'b' included in fopen() mode parameter.


파일에 글 내용을 저정할 수 있는 함수이다.

fclose,fopen,fwrite 이 세가지 함수를 가지고 무엇을 할 수 있을지는 고민해 보자.

    $dir = fopen($path,"w");
    fwrite($dir,"
        <?
        $G_COMPANY_NAME = '$G_COMPANY_NAME';

        $G_COMAPNY_TEL = '$G_COMAPNY_TEL';

        $G_SHOP_CODE = '$G_SHOP_CODE';

        $G_SHOP_NAME = '$G_SHOP_NAME';

        $G_SHOP_DOMAIN = '$G_SHOP_DOMAIN';

        $G_SHOP_DOMAIN_IMAGE = '$G_SHOP_DOMAIN_IMAGE';

        $G_SHOP_TEL = '$G_SHOP_TEL';

        $G_SHOP_TITLE = '$G_SHOP_TITLE';

        $G_FREE_DLV_FEE_LIMIT = '$G_FREE_DLV_FEE_LIMIT';

        $G_DLV_FEE = '$G_DLV_FEE';
        ?>
    ");
    fclose($dir);


파일 경로를 맞추고 해보자..

파일이 생성된다..신기하다.

'php' 카테고리의 다른 글

readdir() -> 파일관리 함수 5  (0) 2008/07/01
opendir() -> 파일관리 함수 4  (0) 2008/07/01
fwrite() ->파일생성 함수  (0) 2008/07/01
fclose() -> php 파일관리 함수 2  (0) 2008/07/01
fopen() -> php 파일관리 함수 1  (0) 2008/07/01
explode  (0) 2008/06/30
posted by 희윤
TAG
 <PREV 1 ... 27 28 29 30 31 32 33 34 35 ... 48    NEXT>