본문 바로가기

프로그램&DB/PHP

PHP File Handling 파일 관련 함수 PHP File Handling The fopen() function is used to open files in PHP. Opening a File The fopen() function is used to open files in PHP. The first parameter of this function contains the name of the file to be opened and the second parameter specifies in which mode the file should be opened: The file may be opened in one of the following modes: Modes Description r Read only. Starts at the beginnin.. 더보기
PHP Include File 인클루드 파일 PHP Include File Server Side Includes (SSI) You can insert the content of one PHP file into another PHP file before the server executes it, with the include() or require() function. The two functions are identical in every way, except how they handle errors: include() generates a warning, but the script will continue execution require() generates a fatal error, and the script will stop These two.. 더보기
PHP Date() Function 날짜 함수 PHP Date() Function The PHP date() function is used to format a time and/or date. The PHP Date() Function The PHP date() function formats a timestamp to a more readable date and time. A timestamp is a sequence of characters, denoting the date and/or time at which a certain event occurred. Syntax date(format,timestamp) Parameter Description format Required. Specifies the format of the timestamp t.. 더보기
PHP $_POST Function 함수 예문포함 PHP $_POST Function The built-in $_POST function is used to collect values in a form with method="post". The $_POST Function The built-in $_POST function is used to collect values from a form sent with method="post". Information sent from a form with the POST method is invisible to others and has no limits on the amount of information to send. Note: However, there is an 8 Mb max size for the POS.. 더보기
PHP $_GET Function 함수 예문 포함 PHP $_GET Function The built-in $_GET function is used to collect values in a form with method="get". The $_GET Function The built-in $_GET function is used to collect values from a form sent with method="get". Information sent from a form with the GET method is visible to everyone (it will be displayed in the browser's address bar) and has limits on the amount of information to send. Example Na.. 더보기
PHP Forms and User Input 폼과 유저 인풋 입력 PHP Forms and User Input The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input. PHP Form Handling The most important thing to notice when dealing with HTML forms and PHP is that any form element in an HTML page will automatically be available to your PHP scripts. Example The example below contains an HTML form with two input fields and a submit button: N.. 더보기
PHP Functions 함수 PHP Functions The real power of PHP comes from its functions. In PHP, there are more than 700 built-in functions. PHP Built-in Functions For a complete reference and examples of the built-in functions, please visit our PHP Reference. PHP Functions In this chapter we will show you how to create your own functions. To keep the script from being executed when the page loads, you can put it into a f.. 더보기
PHP Looping - For Loops 반복문 PHP Looping - For Loops Loops execute a block of code a specified number of times, or while a specified condition is true. The for Loop The for loop is used when you know in advance how many times the script should run. Syntax for (init; condition; increment) { code to be executed; } Parameters: init: Mostly used to set a counter (but can be any code to be executed once at the beginning of the l.. 더보기