Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

phpÊý¾Ý¿âµ¼³öÀà µ¼³öJSON,XML,WORD,EXCEL

from£ºhttp://www.xland.com.cn/article/7/81/0804/28778.htm
±¾ÀàʵÏÖ£º
Êý¾Ý¿âÐÅÏ¢µ¼³ö£ºword£¬excel£¬json£¬xml£¬sql
Êý¾Ý¿â»Ö¸´£º´Ósql£¬´ÓÎļþ
¾ßÌåÓ÷¨:
Ê×ÏÈн¨²âÊÔÓÃÊý¾Ý¿âmytest£¬È»ºóÔÚÀïÃ潨Õűí
PHP´úÂë:
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
--
-- ±íµÄ½á¹¹ `test`
--
CREATE TABLE `test` (
   `id` int(11) NOT NULL auto_increment,
   `name` varchar(100) NOT NULL,
   `email` varchar(200) NOT NULL,
   `age` int(3) NOT NULL,
   PRIMARY KEY   (`id`)
) ENGINE=MyISAM   DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- µ¼³ö±íÖеÄÊý¾Ý `test`
--
INSERT INTO `test` (`id`, `name`, `email`, `age`) VALUES
(1, 'pjq518', [email=]'pjq518@126.com'[/email], 22),
(2, 'xiaoyu', [email=]'xiaoyu@126.com'[/email], 21);
1.µ¼³öextÄÜ·½±ãµ÷ÓõÄjson
PHP´úÂë:
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
 $db=new db();
echo  $db->toExtJson('test');
//Êä³ö½á¹ûΪ
//{'totalCount':'2','rows':[{'id':'1','name':'pjq518','email':'pjq518@126.com','age':'22'},{'id':'2','name':'xiaoyu','email':'xiaoyu@126.com','age':'21'}]}
toExtJson( $table, $start="0", $limit="10", $cons="")ÓÐ4¸ö²ÎÊý£¬ $tableΪ±íÃû£¬ $consΪÌõ¼þ£¬¿ÉÒÔΪstring»òarray
2µ¼³öxml
PHP´úÂë:
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
 $db=new db();
echo  $db->toExtXml('test');
//Êä³ö½á¹û

3µ¼³öexcelºÍword
PHP´úÂë:
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
 $db=new db();
//toExcel
 $map=array('No','Name','Email','Age');//±íÍ·
 $db->toExcel('test', $map,'µµ°¸');
//µ¼³öword±í¸ñ
// $db->toWord('test', $map,'µµ°¸');
//Ч¹ûÈçÏÂͼ
excel.JPG (27.04 KB)
2008-4-19 11:09

PHP´úÂë:
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
<?php
class Db
{
var  $conn;
function Db( $host="localhost", $user="root", $pass="", $db="mytest")
{
   if(! $this->conn=mysql_connect( $host, $user, $pass))
   die("can't connect to mysql sever");
   mysql_select_db( $db,&ensp


Ïà¹ØÎĵµ£º

PHPÀàµÄ×Ô¶¯¼ÓÔØ

ͨ³£ÎÒÃÇдһ¸öÀàÈçÏ£º
a.php
class A
{
public function __construct()
{
echo "hello world!";
}

page.php
require("a.php");
$a = new A(); 
ÎÒÃÇÊÇͨ¹ýÊÖ¹¤ÒýÓÃij¸öÀàµÄÎļþÀ´ÊµÏÖº¯Êý»òÕßÀàµÄ¼ÓÔØ
µ«Êǵ±ÏµÍ³±È½ÏÅÓ´ó£¬ÒÔ¼°ÕâЩÀàµÄÎļþºÜ¶àµÄʱºò£¬ÕâÖÖ·½Ê½¾ÍÏԵ÷dz ......

javaÉú³ÉXMLÎļþ×Ô¶¯»»ÐÐÎÊÌâ

Java codeFormat ft=Format.getRawFormat();
ft.setEncoding("utf-8");
ft.setIndent("    ");//ÉèÖÃËõ½ø
       
XMLOutputter outputter=new XMLOutputter(ft);//ÉèÖÃXML¸ñʽ
Õâλ˵µÄ²»´í£»
ÔÚieÀïÃ棬ËüÄÜ°Ñxml×Ô¶¯½âÎö³ÆÊ÷Ðνṹ£¬ËùÒÔ¿´ÆðÀ´Ã»ÎÊÌ⣬ÔÚ¼Çʱ¾ÀïÃ棬¾Í²»ÐÐÁ ......

nginx php mysql

°²×° Nginx
* Ò»ÌõÃüÁî¸ã¶¨£º
USE=fastcgi emerge nginx
* н¨Óû§ºÍ×飺
groupadd www
useradd www -g www
Nginx °²×°ºÃºóĬÈÏ»áÌí¼Ó nginx ×éºÍ nginx Óû§£¬²»¹ýÎÒ±¾Éí»¹ÊÇÏ°¹ßн¨¸ö www ×éºÍ www Óû§À´×ö HTTP ·þÎñÓû§¡£Èô½ñºó HTTP ·þÎñÆ÷¸ü»»Îª apache »òÊÇ lighttpd ʱ£¬Óû§ÃûºÍÓû§×é¿ÉÒÔ²»±ä¡£
°²×° M ......

php¼ì²âajax·½Ê½µÄµ÷ÓÃÇëÇó

±ÈÈçÒª¸øÓû§±¨¸æÒ»¸ö´íÎó£¬ÓÃÏÂÃæµÄ·½·¨£º
ʹÓÃset_error_handlerÉèÖÃ×Ô¼ºµÄ´íÎó´¦Àíº¯Êý£¬ÔÚ±¨´íµÄµØ·½Ê¹ÓÃtrigger_error£¬ÔÚ×Ô¶¨ÒåµÄ´íÎó´¦Àíº¯ÊýÖиøÓû§ÏÔʾһ¸ö³ö´íÐÅÏ¢Ò³Ãæ¡£
µ«
ÊÇÈç¹ûµ÷ÓÃtrigger_errorµÄÕâ¸öÒ³ÃæÊDZ»Ò»´ÎajaxÇëÇó´¥·¢µÄ£¬ÄÇôajax·µ»Øºó½«µÃµ½Ò»´ó¶ÑÓÃÓÚÏÔʾ´íÎóµÄhtml´úÂë¡£¶øÒ»°ã
ajaxµ÷Óö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ