태터데스크 관리자

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

태터데스크 메시지

저장하였습니다.

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

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
2009/04/10 14:19 php

pow(3,2) 는 3의 2승 9를 나타낸다.

'php' 카테고리의 다른 글

php 제곱 함수.  (0) 2009/04/10
apache php 설치  (0) 2008/10/16
숫자 함수  (0) 2008/07/30
PHP strlen()  (0) 2008/07/18
PHP continue 함수  (0) 2008/07/18
readdir() -> 파일관리 함수 5  (0) 2008/07/01
posted by 희윤
2008/10/16 19:27 php

▶ httpd.conf 파일 수정
   두 줄 추가
---------------------------------------------------------------------------
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

모든것을 다 했는데도 설치가 되지않을 경우
위의 두줄을 추가해 보자.

'php' 카테고리의 다른 글

php 제곱 함수.  (0) 2009/04/10
apache php 설치  (0) 2008/10/16
숫자 함수  (0) 2008/07/30
PHP strlen()  (0) 2008/07/18
PHP continue 함수  (0) 2008/07/18
readdir() -> 파일관리 함수 5  (0) 2008/07/01
posted by 희윤
2008/07/30 14:31 php
round() -> 반올림
floor() -> 내림
ceil() -> 올림

'php' 카테고리의 다른 글

php 제곱 함수.  (0) 2009/04/10
apache php 설치  (0) 2008/10/16
숫자 함수  (0) 2008/07/30
PHP strlen()  (0) 2008/07/18
PHP continue 함수  (0) 2008/07/18
readdir() -> 파일관리 함수 5  (0) 2008/07/01
posted by 희윤
2008/07/18 10:51 php

strlen()

주어진 문자열의 길이(length)를 리턴하는 함수

Examples

Example #1 A strlen() example

<?php
$str
= 'abcdef';
echo
strlen($str); // 6

$str = ' ab cd ';
echo
strlen($str); // 7
?>

'php' 카테고리의 다른 글

apache php 설치  (0) 2008/10/16
숫자 함수  (0) 2008/07/30
PHP strlen()  (0) 2008/07/18
PHP continue 함수  (0) 2008/07/18
readdir() -> 파일관리 함수 5  (0) 2008/07/01
opendir() -> 파일관리 함수 4  (0) 2008/07/01
posted by 희윤
2008/07/18 10:34 php

continue

continue는 루프 구조 내부에서 현재 루프 반복의 나머지 부분을 생략하고 조건 평가를 한 후 다음 반복 시작에서 실행을 지속하게 합니다.

Note: PHP에서 switch구문은 continue에 의해 루프 구조로 사용할수 있다는것을 참고할것.

continue는 숫자 인자 옵션을 사용하여 루프의 깊이를 표시할수 있고, 루프의 끝까지 건너뛸수 있다.

<?php
while (list($key, $value) = each($arr)) {
    if (!(
$key % 2)) { // skip odd members
       
continue;
    }
   
do_something_odd($value);
}

$i = 0;
while (
$i++ < 5) {
    echo
"Outer<br />\n";
    while (
1) {
        echo
"&nbsp;&nbsp;Middle<br />\n";
        while (
1) {
            echo
"&nbsp;&nbsp;Inner<br/ >\n";
            continue
3;
        }
        echo
"This never gets output.<br />\n";
    }
    echo
"Neither does this.<br />\n";
}
?>


'php' 카테고리의 다른 글

숫자 함수  (0) 2008/07/30
PHP strlen()  (0) 2008/07/18
PHP continue 함수  (0) 2008/07/18
readdir() -> 파일관리 함수 5  (0) 2008/07/01
opendir() -> 파일관리 함수 4  (0) 2008/07/01
fwrite() ->파일생성 함수  (0) 2008/07/01
posted by 희윤
2008/07/01 10:54 php

readdir

(PHP 3, PHP 4 )

readdir -- read entry from directory handle

Description

string readdir ( resource dir_handle)

Returns the filename of the next file from the directory. The filenames are returned in the order in which they are stored by the filesystem.

Please note the fashion in which readdir()'s return value is checked in the examples below. We are explicitly testing whether the return value is identical to (equal to and of the same type as--see Comparison Operators for more information) FALSE since otherwise, any directory entry whose name evaluates to FALSE will stop the loop.

Example 1. List all files in a directory

// Note that !== did not exist until 4.0.0-RC2
<?php
if ($handle = opendir('/path/to/files')) {
    echo "Directory handle: $handle\n";
    echo "Files:\n";

    /* This is the correct way to loop over the directory. */
    while (false !== ($file = readdir($handle))) { 
        echo "$file\n";
    }

    /* This is the WRONG way to loop over the directory. */
    while ($file = readdir($handle)) { 
        echo "$file\n";
    }

    closedir($handle); 
}
?>

Note that readdir() will return the . and .. entries. If you don't want these, simply strip them out:

Example 2. List all files in the current directory and strip out . and ..

<?php 
if ($handle = opendir('.')) {
    while (false !== ($file = readdir($handle))) { 
        if ($file != "." && $file != "..") { 
            echo "$file\n"; 
        } 
    }
    closedir($handle); 
}
?>

'php' 카테고리의 다른 글

PHP strlen()  (0) 2008/07/18
PHP continue 함수  (0) 2008/07/18
readdir() -> 파일관리 함수 5  (0) 2008/07/01
opendir() -> 파일관리 함수 4  (0) 2008/07/01
fwrite() ->파일생성 함수  (0) 2008/07/01
fclose() -> php 파일관리 함수 2  (0) 2008/07/01
posted by 희윤
TAG PHP
2008/07/01 10:52 php

opendir

(PHP 3, PHP 4 )

opendir -- open directory handle

Description

resource opendir ( string path)

Returns a directory handle to be used in subsequent closedir(), readdir(), and rewinddir() calls.

If path is not a valid directory or the directory can not be opened due to permission restrictions or filesystem errors, opendir() returns FALSE and generates a PHP error. You can suppress the error output of opendir() by prepending `@' to the front of the function name.

Example 1. opendir() example

<?php

if ($dir = @opendir("/tmp")) {
  while (($file = readdir($dir)) !== false) {
    echo "$file\n";
  }  
  closedir($dir);
}

?>

해당 디렉토리 여는 함수.

'php' 카테고리의 다른 글

PHP continue 함수  (0) 2008/07/18
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
posted by 희윤
TAG PHP
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 PHP
2008/07/01 10:11 php

fclose

(PHP 3, PHP 4 )

fclose -- Closes an open file pointer

Description

bool fclose ( int fp)

The file pointed to by fp is closed.

Returns TRUE on success, FALSE on failure.

The file pointer must be valid, and must point to a file successfully opened by fopen() or fsockopen().

파일을 닫는 함수.

파일 컨트롤 시 꼭 필요한 함수 이다.

'php' 카테고리의 다른 글

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
stripslashes  (0) 2008/06/30
posted by 희윤
TAG PHP
2008/07/01 10:06 php

fopen

(PHP 3, PHP 4 )

fopen -- Opens file or URL

Description

int fopen ( string filename, string mode [, int use_include_path])

If filename begins with "http://" (not case sensitive), an HTTP 1.0 connection is opened to the specified server, the page is requested using the HTTP GET method, and a file pointer is returned to the beginning of the body of the response. A 'Host:' header is sent with the request in order to handle name-based virtual hosts.

Example 1. fopen() example

$fp = fopen ("/home/rasmus/file.txt", "r");
$fp = fopen ("/home/rasmus/file.gif", "wb");
$fp = fopen ("http://www.example.com/", "r");
$fp = fopen ("ftp://user:password@example.com/", "w");

If you are experiencing problems with reading and writing to files and you're using the server module version of PHP, remember to make sure that the files and directories you're using are accessible to the server process.

On the Windows platform, be careful to escape any backslashes used in the path to the file, or use forward slashes.

$fp = fopen ("c:\\data\\info.txt", "r");

'php' 카테고리의 다른 글

fwrite() ->파일생성 함수  (0) 2008/07/01
fclose() -> php 파일관리 함수 2  (0) 2008/07/01
fopen() -> php 파일관리 함수 1  (0) 2008/07/01
explode  (0) 2008/06/30
stripslashes  (0) 2008/06/30
number_format  (0) 2008/06/30
posted by 희윤
TAG PHP