Revision: 55892
Updated Code
at February 27, 2012 11:38 by safe1981
Updated Code
<?php /**************************/ //ë°°ì—´ì„ ì–¸ë°©ë²• /**************************/ $entry = array('Sample Title','April 13,2009', 'Jason'); echo $entry[0], ' by ', $entry[2]; //Sample Title by Jason ì´ ì¶œë ¥ë¨ /**************************/ //다른 ë°©ì‹ì˜ ë°°ì—´ì„ ì–¸(Key,Value 스타ì¼) /**************************/ $entry2 = array( 'title' => 'Sample Title', 'date' => 'April 13,2009' ); echo $entry['title']; //ê²°ê³¼: Sample Title /**************************/ //문ìžì—´ ê²°í•©(String Concatenation) - period(.)으로 ì—°ê²° /**************************/ $foo = "This is a " . "string.!"; echo $foo; /**************************/ //Echoì¶œë ¥ë°©ì‹ ìŒë”°ì˜´í‘œ,í™‘ë”°ì˜´í‘œì— ë”°ë¼ ë‹¬ë¼ì§ /**************************/ $test = "abcde"; echo "hello world $test"; //ê²°ê³¼:hello world abcde echo 'hello world $test'; //ê²°ê³¼:hello world $test /**************************/ //echo를 ì´ìš©í•˜ì—¬ ë°°ì—´ ì¶œë ¥í•˜ê¸°, 중괄호({})를 사용하지 않는 경우ì—는 //ì¸ë±ìŠ¤ì— 홑따옴표가 없는 ê²ƒì— ì£¼ì˜ /**************************/ $person = array('name' => 'Jason', 'age'=>23); echo "This Person's name is {$person['name']} and he is $person[age]"; /**************************/ //printf사용구문 /**************************/ $amt1 = 2.55; $amt2 = 3.55; $total = $amt1 + $amt2; $string = "변수입니닷."; echo "ì´ ê°€ê²©ì€ $",$total, "<br />"; printf("ì´ ê°€ê²©ì€ $%.2f <br />", $total); //í¬ë§·íŒ… ìš©ë„ë¡œ 활용가능 printf("문ìžì—´ 변수로 ìž…ë ¥ê°€ëŠ¥ %s", $string); />
Revision: 55891
Updated Code
at February 27, 2012 11:38 by safe1981
Updated Code
<?php /**************************/ //배���방� /**************************/ $entry = array('Sample Title','April 13,2009', 'Jason'); echo $entry[0], ' by ', $entry[2]; //Sample Title by Jason � �력� /**************************/ //�른 방�� 배���(Key,Value �Ã���) /**************************/ $entry2 = array( 'title' => 'Sample Title', 'date' => 'April 13,2009' ); echo $entry['title']; //ê²°ê³¼: Sample Title /**************************/ //문�� ê²°Ã�©(String Concatenation) - period(.)�� �결 /**************************/ $foo = "This is a " . "string.!"; echo $foo; /**************************/ //Echo�력방� ���Ã��,Ã����Ã��� �� ��� /**************************/ $test = "abcde"; echo "hello world $test"; //ê²°ê³¼:hello world abcde echo 'hello world $test'; //ê²°ê³¼:hello world $test /**************************/ //echo를 ��Ã��� 배� �력Ã��기, ��Ã�¸({})를 ��Ã��� �� 경��� //���� Ã����Ã��� �� �� 주� /**************************/ $person = array('name' => 'Jason', 'age'=>23); echo "This Person's name is {$person['name']} and he is $person[age]"; /**************************/ //printf��구문 /**************************/ $amt1 = 2.55; $amt2 = 3.55; $total = $amt1 + $amt2; $string = "�����."; echo "ì´� �격� $",$total, "<br />"; printf("ì´� �격� $%.2f <br />", $total); //Ã�¬ë§·Ã�� ��� Ã����� printf("문�� ��� �력�� %s", $string); />
Revision: 55890
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at February 27, 2012 11:37 by safe1981
Initial Code
<?php /**************************/ //ë°°ì—´ì„ ì–¸ë°©ë²• /**************************/ $entry = array('Sample Title','April 13,2009', 'Jason'); echo $entry[0], ' by ', $entry[2]; //Sample Title by Jason ì´ ì¶œë ¥ë¨ /**************************/ //다른 ë°©ì‹ì˜ ë°°ì—´ì„ ì–¸(Key,Value 스타ì¼) /**************************/ $entry2 = array( 'title' => 'Sample Title', 'date' => 'April 13,2009' ); echo $entry['title']; //ê²°ê³¼: Sample Title /**************************/ //문ìžì—´ ê²°í•©(String Concatenation) - period(.)으로 ì—°ê²° /**************************/ $foo = "This is a " . "string.!"; echo $foo; /**************************/ //Echoì¶œë ¥ë°©ì‹ ìŒë”°ì˜´í‘œ,í™‘ë”°ì˜´í‘œì— ë”°ë¼ ë‹¬ë¼ì§ /**************************/ $test = "abcde"; echo "hello world $test"; //ê²°ê³¼:hello world abcde echo 'hello world $test'; //ê²°ê³¼:hello world $test /**************************/ //echo를 ì´ìš©í•˜ì—¬ ë°°ì—´ ì¶œë ¥í•˜ê¸°, 중괄호({})를 사용하지 않는 경우ì—는 //ì¸ë±ìŠ¤ì— 홑따옴표가 없는 ê²ƒì— ì£¼ì˜ /**************************/ $person = array('name' => 'Jason', 'age'=>23); echo "This Person's name is {$person['name']} and he is $person[age]"; /**************************/ //printf사용구문 /**************************/ $amt1 = 2.55; $amt2 = 3.55; $total = $amt1 + $amt2; $string = "변수입니닷."; echo "ì´ ê°€ê²©ì€ $",$total, "<br />"; printf("ì´ ê°€ê²©ì€ $%.2f <br />", $total); //í¬ë§·íŒ… ìš©ë„ë¡œ 활용가능 printf("문ìžì—´ 변수로 ìž…ë ¥ê°€ëŠ¥ %s", $string); />
Initial URL
Initial Description
PHPì—ì„œ 사용하기 위한 기본문법
Initial Title
PHP Basic Syntax
Initial Tags
Initial Language
PHP