반응형
반응형
반응형

 

IIS PHP 환경에서

파일 상대경로 에러 날때!!

 

 

출처 - http://blog.daum.net/kbh0007/11090037

반응형

'공부거리 > PHP' 카테고리의 다른 글

php 달력  (0) 2014.05.13
PHP 문자열 함수  (0) 2013.05.29
[PHP] $_SERVER[] 값  (0) 2013.04.04
php,jsp,asp 이전 페이지 URL 얻어오기  (0) 2012.06.14
이클립스+php셋팅  (0) 2012.05.11
반응형

PHP 문자열 함수

 

 ● 문자열 다듬기

 - trim(), ltrim(), chop()에서 지우는 공백은 스페이스, '\n'(줄바꿈), '\t'(가로 탭), '\v',

 ○ trim();

      - 문자열의 처음과 끝에 있는 공백을 지운다.

 ○ ltrim();

      - 문자열의 처음에 있는 공백을 지운다.

 ○ chop();

      - 문자열의 끝에 있는 공백을 지운다.

 

 ● 문자열 정돈

 ○ nl2br();

      - 문자열중 줄바꿈문자(\n)를 XHTML에서의 줄바꾸기인 <br/>태그로 바꾸어 준다.(4.0.5 이전의 HTML에서는 <br>태그)

 

 ● 문자열의 대소문자 관련 함수

 ○ strtoupper();

      - 모든 알파벳을 대문자로

 ○ strtolower();

      - 모든 알파벳을 소문자로

 ○ ucfirst();

      - 문장의 처음이 알파벳이면 그것만 대문자로

 ○ ucword();

      - 각 단어의 첫 알파벳을 대문자로

 

 ● 문자열 나누고 합치기

 ○ explode();

      - 지정 문자를 기준으로 문자열의 전, 후를 나누어 배열로 저장한다.

      ex) $email = 'email@email.com';     $email_array = explode('@', $email);

           $email_array[0] → 'email';     $email_array[1] → 'email.com';

 ○ implode();, join();

      - 지정 문자를 기준으로 배열을 전, 후에 배치하여 문자열을 합친다.

      ex) $new_email = implode('@', email_array);     $new_email → 'email@email.com';

 

 ○ strtok();

      -

 ○ substr();

      - 문자열 중 특정 시작부분과 끝부분 사이의 문자열을 추출하는데 사용한다.

      ex) $test = 'PHP Webprogramming';

           $test1 = substr($test, 1);     $test2 = substr($test, -1);     $test3 = substr($test, 5, 8);     $test4 = substr($test, 4, -2);

           $test1 → 'HP Webprogramming'(앞에서 1번 부터)

           $test2 → 'g'(뒤에서 1번 부터)

           $test3 → 'ebprogra'(앞에서 5번부터 8개)

           $test4 → 'Webprogrammi'(앞에서 4번부터 뒤에서 2번까지)

 

 ● 문자열 비교하기

 ○ strcmp();

      - C언어에서의 함수와 같다. 앞의 문자열을 기준으로 같으면 0을, 우선순위가 높으면 -1을, 반대의 경우에는 1을 리턴한다.

      - 단, 대문자와 소문자의 경우 소문자가 우선순위가 더 높다.(ASCII코드의 대소관계를 생각하면 쉽다.)

 ○ strcasecmp();

      - C언어에서의 stricmp()와 같다. 두 문자열을 비교하는 것은 strcmp()와 같지만 대소문자를 구분하지 않는다.

 ○ strnatcmp(); & strnatcasecmp();

      - 이 두 함수는 문자열을 좀더 자연스러운 기준에서 비교한다.(strnatcmp("12","2")의 결과는 1이다.)

      - 이 두 함수의 차이는 대소문자의 구분여부이다.(이 두 함수의 차이는 case의 유무여부이다.)

 

 ● 문자열의 길이 확인하기

 ○ strlen();

      - C언어에서의 함수와 같다. 문자열의 길이를 정수값으로 리턴해준다.

 

 ● 문자열 안에서 문자열 찾기

 ○ strstr();

      - 문자열 안에서 특정 문자열과 일치하는 부분이 있는지 찾아내는데 쓰이는 함수이다.

      - 일치하는 문자열이 있을 때는 해당 문자열이나 문자를 포함하여 이후 문자열을 리턴한다.

      - 일치하는 문자열이 없을 시에는 false를 리턴한다.

      ex) $str='Lion sleep to night';     $res = strstr($str, 'sleep');

           $res → 'sleep to night'

 ○ stristr();

      - strstr()과 같으나 대소문자를 구분하지 않는다.(ABC, Abc, aBC모두 같은 것으로 취급한다.)

 ○ strchr();

      - strstr()과 같으나 문자열대신 문자를 찾는다.

 ○ strrch();

      - strchr()과 같으나 뒤에서 부터 일치하는 문자를 찾기 때문에 마지막으로 나타난 문자부터 문자열을 출력한다.

 

 ● 문자열의 위치 찾아내기

 ○ strpos();

      - 문자열 내에서 일치하는 문자열이나 문자를 찾아 문자열 대신 해당 위치를 숫자로 알려준다.

      ex) $test = 'Ice cream';     $res1 = strpos($test, 'a');     $res2 = strpos($test, 'e');

           $res1 → 7(0부터 시작한다.)     $res2 = 2(일치하는 문자나 문자열이 많을 경우 가장 앞의 것을 기준으로 한다.)

      ex) $test = 'Ice cream';     $res = strpos($test, 'e', 4);

           $res = 6(앞에서부터 4번째에 있는 c부터 해당문자열의 위치를 찾는다.)

      ※ 이 예에서는 문자만 사용하였지만 문자열도 얼마든지 사용할 수 있다.

 ○ strrpos();

      - strpos와 비슷하나 찾는 문자가 가장 마지막에 보이는 곳의 위치를 리턴한다.

      ※ strrpos()는 strpos()와 달리 문자만 사용할 수 있다.

 ※ 두 함수 모두 만약 문자열에 needle(찾는 문자나 문자열)이 없으면 false를 리턴하는데 PHP에서는 false를 0과 같다고 보기 때문에

      위치 0을 리턴한것인지 false를 리턴한 것인지 구분할 수가 없다. 이 문제는 === 연산자를 사용하여 해결할 수 있다.

 ex) $res = strpos('Hello world', 'H');     //이 경우에는 가장 앞에 'H'가 있기 때문에 0을 리턴하지만 PHP는 false와 구분하지 못한다.

      if($res === false)

           echo 'Not found';

      else

           echo 'Found at position 0';

 

 ● 문자열 대체하기

 ○ str_replace();

      - 문자열에서 문자열를 찾아 대체문자열로 바꾸어 리턴한다.

      ex) $test = 'Change';     $res = str_replace('g', 'c', $test);

           $res → 'Chance'

 ○ substr_replace();

      - 특정 위치의 문자열을 대체문자열로 바꾸어 리턴한다.

      ex) $test = 'Vitamin A'; $res = substr_replace($test, 'C', -1);

           $res → 'vitamin C'

 

 

출처 : http://pairh.blog.me/10099470231

반응형
반응형

$_SERVER['DOCUMENT_ROOT'] = 현재 사이트가 위치한 서버상의 위치 => /webapp/include


$_SERVER['HTTP_ACCEPT_ENCODING'] = 인코딩 받식 => gzip, deflate


$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 언어 => ko


$_SERVER['HTTP_USER_AGENT'] = 사이트 접속한 사용자 환경 => Mozilla/4.0(compatible; MSIE 6.0; Windows NT 5.1; Q312461; .NET CLR 1.0.3705


$_SERVER['REMOTE_ADDR'] = 사이트 접속한 사용자 IP => xxx.xxx.xxx.xxx

$_SERVER['HTTP_REFERER'] = 현제 페이지로 오기전의 페이지주소값 => http://www.test.net/index.php?user=??? (A태그나 form으로 전송시 값이 넘어옴. onclick으로 전송시 값이 넘어오지 않음)


$_SERVER['SCRIPT_FILENAME'] = 실행되고 있는 위치와 파일명 => webapp/include/index.php


$_SERVER['SERVER_NAME'] = 사이트 도메인 => www.test.com (버추얼 호스트에 지정한 도메인)

$_SERVER['HTTP_HOST'] = 사이트 도메인 => www.test.com (접속할 때 사용한 도메인)


$_SERVER['SERVER_PORT'] = 사이트가 사용하는 포트 => 80


$_SERVER['SERVER_SOFTWARE'] = 서버의 소프트웨어 환경 => Apache/1.3.23 (Unix) PHP/4.1.2 mod_fastcgi/2.2.10 mod_throttle/3.1.2 mod_ssl/2.8.6 OpenSSL/0.9.6c


$_SERVER['GATEWAY_INTERFACE'] = cGI 정보 => CGI/1.1


$_SERVER['SERVER_PROTOCOL'] = 사용된 서버 프로토콜 => HTTP/1.1


$_SERVER['REQUEST_URI'] = 현재페이지의 주소에서 도메인 제외 => /index.php?user=???&name=???


$_SERVER['PHP_SELF'] = 현재페이지의 주소에서 도메인과 넘겨지는 값 제외 = /default/index.php

*파일명만 가져올때 : basename($_SERVER['PHP_SELF']);


$_SERVER['APPL_PHYSICAL_PATH'] = 현재페이지의 실제 파일 주소 => D:\webapp/

$_SERVER['QUERY_STRING'] = get방식의 파일명 뒤에 붙어서 넘어오는 값 => ?user=???&name=??? (반드시get방식으로 넘겨야됨)

반응형
반응형

HTTP 환경변수의 HTTP_REFERER를 이용해봅시다'ㅂ'

(import javax.servlet.http.HttpServletRequest;)

각 언어별로 HTTP_REFERER를 확인하는 방법은 아래와 같습니다. 리턴값은 스트링이구요.

ASP => Request.ServerVariables("HTTP_REFERER")
PHP => $_SERVER['HTTP_REFERER']
JSP => request.getHeader("REFERER")

HTTP_REFERER의 값의 유무와 각 웹서버의 로그파일을 이용해서
어떻게 방문했는지를 추출할 수 있습니다.

1. 주소창에 주소를 입력해서 들어오는 경우
- HTTP_REFERER의 값이 없음

ex)strReferPath = Trim(Request.Servervariables("HTTP_REFERER"))

strReferPath == null ? 1 : 0 -> 1이 반환 되겠져

2. '즐겨찾기'를 이용해서 들어오는 경우(IE의 경우)
- HTTP_REFERER의 값이 없음
- 로그파일에 ..../favicon.ico로그가 먼저 남는다.
- 이는 IE가 즐겨찾기를 눌러서 사이트를 방문할 경우 favicon.ico 요청을 하고, 해당 URL의 요청을 하기때문입니다.

3. 링크를 통해서 들어오는 경우.(쉽게 말해서 <a>태그를 통해)
- HTTP_REFERER에 이전 URL정보가 들어있음.

이렇게 3가지 패턴으로 어느정도 확인을 할 수가 있습니다만-!

자바스크립트로 location.href를 통해 설정된 주소로 들어왔을경우

이전의 주소를 알아 낼 수 없다는 거겠죠; 그 밖에도 여러가지가 있겠지만...

 

출처 - http://blog.naver.com/wimeprana/110019137746

반응형

'공부거리 > PHP' 카테고리의 다른 글

PHP 문자열 함수  (0) 2013.05.29
[PHP] $_SERVER[] 값  (0) 2013.04.04
이클립스+php셋팅  (0) 2012.05.11
PHP 게시판 리스트 샘플 소스  (0) 2011.12.19
PHP3 문법 기초  (0) 2011.10.12
반응형


Step 1: Download and Install Eclipse

Go to http://www.eclipse.org/download and download 'Eclipse Classic' (Don't download Eclipse PHP package), at the time of writing this Indigo (3.7) was the most current release.

Once downloaded, un tar ball/unzip and install Eclipse.

Next start up eclipse and choose your workspace folder.

Step 2: Settings up PHP PDT Plugin

Alright once you have Eclipse up and running, your going to want to navigate to 'Help > Install New Software'.

This will bring you to a screen like so

If you look twords the top of that window you will see a drop down that says 'Wok With', click that and select '--All Available Sites--'.

Next you are going to want to search for 'PHP', this will list the same plugin in three different categories. Just select the first one that says 'PHP Development Tools (PDT)...' and then click 'Next' and run though the install process. Its is pretty straight forward. It will ask you to restart Eclipse click 'Restart Now'. Thats it you now have the PHP PDT plugin installed. This plugin by its self is not super useful because of the way the it is encased in Exlipses 'project' mentality.

From here on out when ever I say go and install new software, you should follow these steps.

Step 3: Install Remote System

You are going to follow the same instruction as above, but you are going to search for 'Remote System', remeber to select '--All Available Sites--' in the 'work with' drop down. Click 'Remote System Explorer End-User Runtime' and 'Remote System Explorer User Actions' and run through the install process like before.

Step 4: Install Theme Switcher (Optional)

The setup for the theme switch is same as the above EXCEPT next to the 'work with' drop down you will see a 'add' button, click that. Fill out the form and enter this as the 'Location':

http://eclipse-color-theme.github.com/update

click ok, and in the list of available plugins to install you should only see one choice 'Eclipse Color Theme'. Check the box and run through the install process, it may give you a warning about installing software from outside sources, just click ok and continue.

Once Eclipse Theme is install you can navigate to Ecplise Preference, on mac they are in 'Eclipse > Preferences', on windows I think they are in 'File > Preferences'.

This will open a window with tons of options. All I want you to be aware of at this point is under 'General > Appearance > Color Theme'. This was added by the theme plugin. Here you can change your theme to what ever you prefer.

Step 5: Install Drupal plugin (Optional)

I work a lot with the content management system Drupal and thought it would be nice to note that there is an Drupal Eclipse Plugin.

To install the plugin it is going to be similar to the theme plugin above. Navigate to 'Help > Install New Software' and add a new site like above and enter the location as:

http://xtnd.us/downloads/eclipse

Again after adding this new location you will be prompted with only once choice. Just select 'Drupal for Eclipse' and run though the setup.

Step 6: Configuring PHP

By defualt in Eclipse 3.7 and greater php file will not automatically open in Eclipse.

Go to 'Eclipse >Preferences' (Mac) or 'File > Preferences'(Windows) and then go to 'general > editors > file associations'.

click the add button on the left and enter '*.php' with out the quotes.

After you hit ok you will see a list of editors below. Click on 'PHP Editor' and then click the default button on the right. And then click ok.

Step 7: Configuring Remote System Explorer

First thing you need to do is add the Remote System Explorer perspective to your eclipse workspace.

Go to 'Window > Open Perspective > Other'. now look for Remote System Explorer and add that.

Now you will have a new tab in your Eclipse workspace. By defualt you can browse and edit local files on your hard drive with RSE.

Now the fun part setting up a new conennection.Clcik the little down arrow in the 'Remote System' tab and select 'New Connection'

The next screen shows you all diffecent types of connection. I am going to walk through setting up a ssh connection. So on the next screen select 'SSh Only' and select Next.

the next screen you will need to enter in your host. I am not going to show a picture of this step.

Now you have a new connection in your 'Remote System' tab if you unfold it you will see 'My home' and 'Root'. By default RSE gives you these two file filters to choose from.

If you want to add another filter you want to right click on 'Sftp Files' and go to 'New > Filter'.

Next you will enter in the file location you would like to start from, like /home/test. Select next, give the filter and name and click ok.

Step 8: Fixing PHP autocomplete with Remote System Explorer

The last step is fixing the php autocomplete feature. To do this you are going to have edit a hidden file in your workspace folder. But first we are going to enable hidden files on RSE. Go to 'Eclipse > Preferences' (Mac) or 'File > Preferences' (Windows) and then unfold 'Remote Systems > Files'.

Check 'Show Hidden Files' and click ok.

Now we are going to use RSE to edit an eclipse RSE .project file. So in your 'Remote System' tab open up your local files and navigate to you workspace folder. Look for a folder called 'RemoteSystemsTempFiles' and open that. Now you are going to edit the '.project' file. Open up that file.

You are going to add two line in between the <natures> tag, those lines are

1
2
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.php.core.PHPNature</nature>
Save that file and restart eclipse. If you did everything correctly you should now have auto complete that will look like so
Well thats it, you should now have a fully fuction Eclipse web developing enviornment. Hope you enjoyed it, let me know if you find any errors in my work.




출처 - http://onlybible.tistory.com/7514

반응형

'공부거리 > PHP' 카테고리의 다른 글

PHP 문자열 함수  (0) 2013.05.29
[PHP] $_SERVER[] 값  (0) 2013.04.04
php,jsp,asp 이전 페이지 URL 얻어오기  (0) 2012.06.14
PHP 게시판 리스트 샘플 소스  (0) 2011.12.19
PHP3 문법 기초  (0) 2011.10.12
반응형

$db_host = "localhost";
 $db_name = "ID";
 $db_pss = "PASS";

 $connect = mysql_connect($db_host, $db_name,$db_pss );
 $result_0 = mysql_query($db_name, $connect);
 echo $result_0."<br>";
 mysql_select_db("DBNAME", $connect);
 mysql_query("SET NAMES utf8");


$sql_4 = "select * from juso";
 $result_4 = mysql_query($sql_4, $connect);
 $fields = mysql_num_fields($result_4); //총 필드 갯수
 echo "fileds = ".$fields."<br>";
 if($v_num != null || $v_num == ""){
  echo "<center>";
  echo "<br>주소록 검색 결과.<br>";
  
  echo "<table align='center' width='1024px'>
    <tr>
     <th align-'center'>선택</th>
     <th align='center'>이름</th>
     <th align='center'>주소</th>
     <th align='center'>전화</th>
     <th align='center'>비고</th>
     <th align='center'>삭제</th>
    </tr>";
    echo "<tr>";
    echo "<td colspan='6'><HR align='conter'  width='1024px'  ></td>";
    echo "</tr>";
    $ee=1;
   while($row = mysql_fetch_row($result_4)){
    echo "<tr>";
    echo "<td align='center'>".$ee++."</td>";
    echo"<td align='center'>".$row[$i]."</td>";
    };
    echo "<td align='center'>".$row[0]."</td>";//삭제버튼
    echo "</tr>";  
   }
  echo "</table>";

반응형

'공부거리 > PHP' 카테고리의 다른 글

PHP 문자열 함수  (0) 2013.05.29
[PHP] $_SERVER[] 값  (0) 2013.04.04
php,jsp,asp 이전 페이지 URL 얻어오기  (0) 2012.06.14
이클립스+php셋팅  (0) 2012.05.11
PHP3 문법 기초  (0) 2011.10.12
반응형

http://www.shinbiro.com/~flyduck/php/index.html 의 자료입니다.


1. Variable (변수)
- 변수는 $로 시작한다.

- 변수는 별도로 선언하는 부분이 없으며 (type을 미리 지정하지 않으며) 변수 type은 변수가 사용된 context에 따라 결정된다.

- 변수의 type으로는 기본적으로 integer, double, string type이 있으며 이외에 array와 object type이 있다. 변수 type은 gettype(), is_long(), is_double(), is_string(), is_array(), is_object() 등의 함수로 알아낼 수 있다.

- type casting은 C에서와 같은 형식으로 이루어진다. (int) (integer) (real) (double) (float) (string) (array) (object) 등의 casting operator가 있다.

- string conversion : 문자열이 숫자로 변환될 때에 문자열이 '.', 'e', 'E'를 포함하고 있으면 double로 그렇지 않으면 integer로 변환이 된다.

- variable variable : 변수의 값이 변수의 이름이 되는 것을 말한다. 예를들어 $a = "hello" 일때 $$a = "world"라고 정의하면 $hello = "world"로 정의되는 것이다.

- scope : user-defined function에서는 local function scope가 적용된다. 즉 function 안에서 정의된 변수는 function안에서만 의미가 있다. 주의할 점은 외부에서 정의된 변수도 user-defined function안에서는 의미가 없다는 것이다. 외부에서 정의된 변수를 사용하려면 함수 안에서 global $externalVar; 형식으로 정의를 하고 사용하거나 $GLOBALS["externalVar"] 형식으로 직접 변수를 사용하여야 한다.

- static variable : local function scope를 가지지만 scope를 벗어나더라도 값이 유지되는 변수를 말한다.

Array

- array는 $array[] 형식으로 사용된다.

- scalar array : 첨자가 숫자로 주어지는 배열이다. 예를 들면 $array[0] = 1;

- associative array : 첨자가 숫자가 아니라 문자열로 주어지는 배열이다. 예를 들면 $array["first"] = 1;

- 그냥 $array[]에 값을 지정하면 array에 값이 하나 추가된다. $array[] = 1; $array[] = 2; 는 $array[0] = 1; $array[1] = 2;와 같은 의미를 지닌다.

- array() 함수를 통하여 array를 만들수도 있고, count() 함수로 element의 갯수를 얻을수도 있다. next(), prev() 함수나 each() 함수를 통하여 element들을 참조할 수도 있다.

External Variables (외부변수)

- HTML form (GET/POST) : form으로 전달된 값은 form에서 name field로 지정한 이름의 변수로 지정이 된다. form에서 type = "image"인 경우에는 마우스로 클릭한 위치가 name_x, name_y 형태로 추가로 전달된다.

- HTTP Cookie : browser로 cookie를 전달하려면 SetCookie(name, value, timeout) 함수를 이용한다. client로부터 전달되는 cookie는 PHP 변수로 변환이 된다.

- Environment Variable : 환경변수 또한 PHP 변수처럼 사용할 수 있다. 환경변수는 getenv()라는 함수를 이용해 얻을 수 있으며 putenv() 함수로 환경변수를 지정할 수도 있다.


2. Class
- class keyword를 사용하여 class를 정의하며 instance 생성은 new operator를 이용한다.

- class의 상속은 extends keyword를 사용한다.

- constructor 정의는 class와 같은 이름을 갖는 상수를 정의함으로써 이루어진다. constructor는 default parameter를 가질 수 있다.

예)

    class testClass {
        var $value;
        function testClass($defValue = "test") { $value = $defValue; }
        function doSet($setValue) { $value = $setvalue; }
        function doPrint() { echo $value; }
    }
    class testLineClass extends testClass {
        function doPrintLine() { echo("$valuen"); }
    }

    $test = new testClassLine;
    $test->doSet("hello");
    $test->doPrint();
    $test->doPrintLine();
3. Expression
- expression이란 값으로 환산되는 것을 말한다.

- assignment는 expression이므로 $a = $b = 5; 같은 문장을 쓸 수 있다.

- pre and post increment / decrement : $a++, ++$a, $a--, --$a

- comparison operator는 boolean 값을 갖는 expression이다.

- operator와 assignment의 결합 : $a += 3; $b = ++$a; $c = double(--$b); $d = $c += 10;

- boolean : 숫자에서 0은 false, 0이 아닌값은 true이다. 문자열에서 ""와 "0"은 false, 나머지는 true이다. array에서는 element가 하나도 없으면 false, 하나라도 있으면 true이다.


4. Statement
- if 문 :

    if (expression) {
        do anything 1;
    } elseif (expression) {
        do anything 2;
    } else
        do anything 3;

    또는

    if (expression) :
        do anything 1;
    elseif (expression) :
        do anything 2;
    else :
        do anything 3;
    endif;
- while 문 :

    while (expression)
        do anything;

    또는

    while (expression) :
        do anything;
    endwhile;
- do...while 문 :

    do {
        do anything;
    } while (expression);
- for 문 :

    for (expr1; expr2; expr3)
        do anything;
- switch 문 :

    switch (expression) {
    case ... :
        do anything;
        break;
    default :
        do anything;
    }
- loop에서 break를 이용한 제어가 가능하다.

5. Function (함수)
- 함수는 function 이라는 keyword를 가지고 정의가 되며 별도로 return type은 지정하지 않는다.

- function의 기본형은 다음과 같다.

    function funcName($arg1, $arg2, $arg3, ..., $argn) {
        do anything;
        return $retval;
    }
- return value는 list와 object를 포함하여 어떤 type이든 될 수 있다. 예를 들어 array를 return하려면 return array(0, 1, 2);

- argument는 default로 pass by value이다. pass by reference로 하려면 argument definition에서 변수명 앞에 &를 붙여주면 된다 (function funcName(&$arg1)). function이 pass by value로 정의가 되었더라도 함수를 부를때 argument에 &를 붙여서 넘기면 pass by reference가 된다 (call : doFunc(&$var)).

- default parameter : C++에서 사용하는 방식으로 default parameter를 정의할 수 있다 : function funcName($var = 1) { }


6. Operator
- operator들은 C언어에서의 operator와 비슷하며 다음과 같은 operator들이 있다.

- arithmetic operator : +, -, *, /, %
- string operator : . (concatenation)
- assignment operator : =
- bitwise operator : &, |, ~
- logical operator : and (&&), or (||), xor, !
- comparison operator : ==, !=, <, >, <=, >=


7. 그밖에
- require : #include와 똑같은 의미로 사용된다.

- include : include 문장을 만날때마다 지정한 파일을 포함한다. require는 #include 처럼 무조건 파일을 포함시키지만 include는 loop나 if 문 등에서 사용할 수 있으며 필요한 경우에만 파일을 포함하도록 할 수 있다.

반응형

'공부거리 > PHP' 카테고리의 다른 글

PHP 문자열 함수  (0) 2013.05.29
[PHP] $_SERVER[] 값  (0) 2013.04.04
php,jsp,asp 이전 페이지 URL 얻어오기  (0) 2012.06.14
이클립스+php셋팅  (0) 2012.05.11
PHP 게시판 리스트 샘플 소스  (0) 2011.12.19

+ Recent posts