U E D R , A S I H C RSS

이승한/PHP

/PHP

문 : 보PHP



1.1.

  • 변변
  • include "./input.inc"; // 더는 보 inc . .

1.2. SQL API

  • SQL .
  • asp.net ODBC 를 DB 른듯.

1.2.1. DB


  • ~cpp   
    $dbconn = mysql_connect("<>", "<>", "<>");
    $is_connect = mysql_select_db("<DB >", <mysql_connect , DB보>);
    //  리
    if(<mysql_select_db  면 true, 면 false>){
    	echo("MySql   .");
    } else{
    	echo("connected<br>");
    }
     
  • 1.2.2. query문


    ~cpp 
    $query = "select name, eng, math from score";//리문  .
    $result = mysql_query($query, $dbconn); //<> = mysql_query(<리문 링>, <DB보>); // 2  는 듯.
    $totalRecord = mysql_num_rows($result); //<변> = mysql_num_rows(<>); // 를 변 
    
    if( $totalRecord == 0 ){
    	echo( "  .");
    }else{
    	echo("<tr><td>번</td><td></td><td></td><td></td>");
    	for($i =0; $i< $totalRecord; $i++){
    		$name = mysql_result($result, $i, 0);
    		$eng  = mysql_result($result, $i, 1);
    		$math = mysql_result($result, $i, 2);
    		$no = $i + 1;
    		echo("<tr><td>$no</td>");
    		echo("<td>$name</td>");
    		echo("<td>$eng</td>");
    		echo("<td>$math</td></tr>");
    	}
    }
    

    1.3.2.

    • getenv() //.
      • REMOTE_ADDR: IP
      • HTTP_USER_AGENT :
    • flush() // // 뭔 모르.
    • sleep() //windows sleep .
    • exit() //말 exit()

    1.3.3.

    • time() : 1970 1 1 0 0 0 .
    • date() : date("y/m/d A h:i:s", time());

    1.3.4. string

    PHP 변 . // 맞는 모르. 대략
    • addslashes(); //문를 리. 문 /를 .
    • strcmp($val1, $val2); //면 1 면 0
    • htmlspecilchars(); //& " ' < > 등 HTML . ex>& -> & " ->"
    • nl2br() // n <br> .
    • explode() // 문 . array 모르.
    • implode() //explode

      ~cpp 
      //explode
      $array_string = explode(" ", $string);
      //implode
      $array_string = array("Apple", "Orange", "Banana", "Grape");
      $string = implode(" or ", $array_string);
        
    • substr($변, , ) // . excel middle . substr($string, 0, 5);
    • strlen() //C .
    • str_replace("", "바", $변) // replace
    • ord() // ascii
    • chr() // ascii

    1.4.


      • <? ?> . (ASP는 <% %>를 .)
    • ( ; ) 붙는.
    • : C
    • 뿌리 : echo(" 내<br>");

    1.4.1.

  • : $변 며 변 . type .
  • : 변0, 변1, 변2, 변3
  • : global $변명;
  • : static $변명;
  • 변변 : 변 .
    ~cpp 
      $first = "good";
      $$first = "morning";
      echo("$good");
       
  • 1.4.2. html / form


    ~cpp 
      <form method="post" action="process.php">
      동물 <input type="text" name="animal">
      <input type="submit" value="">
      </form>.
      

    1.4.3.

  • : + - * / % . ++ .
  • 논리 : === != < > <= >= and or xor ! && || 는 C .
  • 1.4.4.

  • if, while, switch, for .
  • break, continue
  • 1.4.5.

    function 명(){ ; return 변;} // Function . return 돼며 type .



    ... 5 php -_-;;;
    는데 php ?
    런데 냐? -
    Valid XHTML 1.0! Valid CSS! powered by MoniWiki
    last modified 2021-02-07 05:30:31
    Processing time 0.0197 sec