2012年4月11日 星期三

PHP 入門

語法:http://www.php.net/manual/en/
先看 Getting StartedLanguage Reference

取得 client 資料:(http://www.php.net/manual/en/reserved.variables.server.php)
1. $username = $_SERVER['PHP_AUTH_USER'];  // HTTP authentication with PHP
2. $remote_addr = $_SERVER['REMOTE_ADDR']; // client IP address
3. $request_time = $_SERVER['REQUEST_TIME']; // client request time

處理檔案:
http://php-learning-simple.mygreatname.com/php-learning/php-open-file-and-read-file.html

讀取目錄:
http://php.net/manual/en/function.readdir.php

呼叫其他的 php
http://www.php5.idv.tw/html.php?mod=article&do=show&shid=77

製作 PDF (http://www.ros.co.nz/pdf/)
require('class.ezpdf.php');
$pdf = &new Cezpdf();
$pdf->selectFont('fonts/Times-Bold.afm');
$pdf->setcolor(0.54,0.54,0.54);
$pdf->addText(150,700,30,"Line 1",40,1);
$pdf->addText(150,600,30,"Line 2",40,1);
$pdfcode = $pdf->ezOutput();
$fp = fopen("myfile.pdf",'wb');
fwrite($fp,$pdfcode);
fclose($fp);

沒有留言:

張貼留言