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 |


| 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 |
| 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 |
| 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 |
Example #1 A strlen() example
<?php
$str = 'abcdef';
echo strlen($str); // 6
$str = ' ab cd ';
echo strlen($str); // 7
?> | 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 |
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 " Middle<br />\n";
while (1) {
echo " Inner<br/ >\n";
continue 3;
}
echo "This never gets output.<br />\n";
}
echo "Neither does this.<br />\n";
}
?> | 숫자 함수 (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 |
(PHP 3, PHP 4 )
readdir -- read entry from directory handleReturns 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 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 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 |
(PHP 3, PHP 4 )
opendir -- open directory handleReturns 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 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 |
(PHP 3, PHP 4 )
fwrite -- Binary-safe file writefwrite() 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.
| 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 |
(PHP 3, PHP 4 )
fclose -- Closes an open file pointerThe 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().
파일을 닫는 함수.
파일 컨트롤 시 꼭 필요한 함수 이다.
| 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 |
(PHP 3, PHP 4 )
fopen -- Opens file or URL|
Example 1. fopen() example
|
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"); |
| 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 |