php¶ÁÈ¡ºÍ´´½¨wordÎĵµ
×ܽáϱ¾ÈËÔÚÈÕ³£¹¤×÷ÖÐʹÓÃphp²Ù×÷wordµÄһЩʵս¡£
·½·¨Ò»£ºÀûÓÃphp comÄ£¿é
¡£Ò²¼´ÀûÓÃwordÌṩµÄ±¾µØapi£¬ËùÓÐÖ»ÊÊÓÃÓÚwindowsϵͳÉÏ¡£
<?php
$word = new com('word.application') or die('ÎÞ·¨´ò¿ªword');
$word->Visiable = false;
$doc_file = '/path/to/doc';
$word->Open($doc_file);
$text = 'Õâ¶ÎÎÄ×Ö½«±»Ð´µ½wordÎĵµÖÐÈ¥';
$word->Selection->TypeText($text);
//±£´æ
$word->ActiveDocument->Save();
//¶ÁÈ¡ÄÚÈÝ
$doc_file_contents = $word->ActiveDocument->Content->Text;
//Êä³öwordÄÚÈÝ
$word->PrintOut();
$word->Close();
?>
ÀûÓÃcomÁ¬½Óword£¬¾³£ÎÞ·¨Ô¤ÆÚÔËÐгɹ¦£¬Ä¿Ç°Ò²²»ÖªµÀÊÇʲôÔÒò£¬ÔÝʱ¿¿ÔËÆø°É¡£
·½·¨¶þ£ºÀûÓÃcatdoc¡£catdocÊÇlinuxÉϵŤ¾ß£¬ÐèÒª×ÔÐа²×°ÅäÖá£
<?php
//catdocλÖÃ
$cat_doc = '/usr/local/bin/catdoc';
$doc_file = 'this is a doc file';
//¶ÁÈ¡wordÎļþÄÚÈÝ
$doc_file_contents = shell_exec($cat_doc . ' ' . $doc_file);
echo nl2br($doc_file_contents);
?>
¸ü¶àcatdocµÄ¹¦ÄÜ£¬Çë²éÔÄcatdocÎĵµ¡£
ÓÉÓÚcatdocÊÇlinuxµÄ¹¤¾ß£¬ËùÒÔÉÏÃæµÄÕâ¶Î´úÂëÖ»ÄÜÔËÐÐÔÚlinux·þÎñÆ÷ÉÏ£¬¶øÒѱØÐë°²×°ÁËcatdoc¡£
Ïà¹ØÎĵµ£º
Õ¾µã½á¹¹
´úÂë:
Õ¾µã
©»includes
©»class.inc
©Çtemplet
©»index.htm
©Çlist.htm
©»content.htm
©Çindex.php
©»content.php
¿â½ ......
ÔÚPHPÍøÕ¾¿ª·¢ÖУ¬ÎªÁËÂú×ãÍøÕ¾µÄÐèÒª£¬Ê±³£ÐèÒª¶ÔPHP»·¾³±äÁ¿½øÐÐÉèÖúÍÓ¦Óã¬ÔÚÐéÄâÖ÷»ú»·¾³Ï£¬ÓÐʱÎÒÃǸüÐèҪͨ¹ýPHP»·¾³±äÁ¿²Ù×÷º¯ÊýÀ´¶ÔPHP»·¾³±äÁ¿Öµ½øÐÐÉèÖá£Îª´ËÎÒÃÇÓбØÒª¶ÔPHP»·¾³±äÁ¿ÏÈÓÐËùÊìϤ¡£½ñÌìºÍ´ó¼Ò·ÖÏíPHP»·¾³±äÁ¿$_SERVERºÍPHPϵͳ³£Á¿µÄ²¿·ÖÏêϸ˵Ã÷¡£
¡¡¡¡PHP»·¾³±äÁ¿Ö÷ÒªÓÐ$GLOBALS[]¡¢$_SERVER ......
±êÌâÓе㳤£¬Æäʵ¾ÍÊÇÓÃÀ´Ïòhttps·þÎñÆ÷postÊý¾Ý
function curlPost($url, $data, $timeout = 30)
{
$ssl = substr($url, 0, 8) == "https://" ? TRUE : FALSE;
$ch = curl_init();
$opt = array(
CURLOPT_URL => $url,
CURLOPT_POST => 1,
CURLOPT_ ......
ϵͳ¼°Èí¼þ°æ±¾
FreeBSD 7.3
Apache-2.2.14-5[ 1.3.42£¨Unix£©]
PHP-5.2.12
MySQL-5.0.90
Freebsdͨ¹ýport°²×°nginx
Nginx ("engine x") ÊÇÒ»¸ö¸ßÐÔÄÜµÄ HTTP ºÍ·´Ïò´úÀí·þÎñÆ÷£¬Ò²ÊÇÒ»¸ö IMAP/POP3/SMTP ´úÀí·þÎñÆ÷¡£ Nginx ÊÇÓÉ Igor Sysoev Ϊ¶íÂÞ˹·ÃÎÊÁ¿µÚ¶þµÄ Rambler.ru Õ¾µã¿ª·¢µÄ£¬ËüÒѾÔÚ¸ÃÕ¾µãÔËÐг¬¹ýÁ½ ......
<?php
class Model_Data_FocusData{
....
public function getData(){...}
}
class Model_Data_IndexData{
....
public function getData(){...}
}
?>
ÓÐÕâô¼¸¸öÀ࣬ϣÍûÄܹ»×Ô¶¯µÄ¸ù¾Ý²ÎÊýÀ´µ÷Óò»Í¬µÄÀà´¦ÀíÊý¾Ý¡£
¿´µ÷ÓÃÄ£¿é£º
<?php
function getData($act){
$class = "Mode ......