[ php ] file_get_contents // file_put_contents (파일 쓰기 // 파일 읽기) > php

본문 바로가기

사이트 내 전체검색

php

[ php ] file_get_contents // file_put_contents (파일 쓰기 // 파일 읽기)

작성일 18-09-27 14:18

페이지 정보

작성자 웹지기 조회 6,501회 댓글 0건

본문

[code]

//파일을 불러들일때

file_get_contents($g4['path']."/data/config/config_default.php");

print_r2($config);


$query = "SELECT * FROM $g4[config_table] ";

$row = sql_fetch($query);


$text = "<?php\n";

$text .= "define('_GNUBOARD_', TRUE);\n";

$text .= "\n\n";

foreach($row AS $item => $val) {

    $text .= "\$config['".$item."'] = \"".$val."\";\n";

}

$text .= "?>";

//파일 입력할때

//파일을 저장하기 위해서는 fwrite와 비슷한 방식이다

file_put_contents($g4['path']."/data/config/config_default1111.php",$text);

[/code]


추천0

비추천 0

댓글목록

등록된 댓글이 없습니다.

전체 82건 5 페이지

이미지 목록

게시물 검색
Copyright © 즐거운 코딩 생활 ( funyphp ). All rights reserved.
PC 버전으로 보기