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

ÓÃPHP¹¹½¨×Ô¶¨ÒåËÑË÷ÒýÇæSphinx

1. ´´½¨Ë÷Òý
$ sudo /usr/local/bin/indexer --config /usr/local/etc/sphinx.conf --all
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
using config file '/usr/local/etc/sphinx.conf'...
indexing index 'catalog'...
collected 8 docs, 0.0 MB
sorted 0.0 Mhits, 82.8% done
total 8 docs, 149 bytes
total 0.010 sec, 14900.00 bytes/sec, 800.00 docs/sec
2.  search ²âÊÔË÷Òý
$ /usr/local/bin/search --config /usr/local/etc/sphinx.conf ENG
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
index 'catalog': query 'ENG ': returned 2 matches of 2 total in 0.000 sec
displaying matches:
1. document=8, weight=1, assembly=5, model=7
id=8
partno=ENG088
descrīption=Cylinder head
price=55
2. document=9, weight=1, assembly=5, model=3
id=9
partno=ENG976
descrīption=Large cylinder head
price=65
words:
1. 'eng': 2 documents, 2 hits
$ /usr/local/bin/search --config /usr/local/etc/sphinx.conf wind
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
index 'catalog': query 'wind ': returned 2 matches of 2 total in 0.000 sec
displaying matches:
1. document=1, weight=1, assembly=3, model=1
id=1
partno=WIN408
descrīption=Portal window
price=423
2. document=5, weight=1, assembly=3, model=1
id=5
partno=WIN958
descrīption=Windshield, front
price=500
words:
1. 'wind': 2 documents, 2 hits
$ /usr/local/bin/search \
--config /usr/local/etc/sphinx.conf --filter model 3 ENG
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
index 'catalog': query 'ENG ': returned 1 matches of 1 total in 0.000 sec
displaying matches:
1. document=9, weight=1, assembly=5, model=3
id=9
partno=ENG976
descrīption=Large cylinder head
price=65
words:
1. 'eng': 2 documents, 2 hits
PHPµ÷ÓÃSphinxËÑË÷ÒýÇæ
£¼?php
include('sphinx-0.9.7/api/sphinxapi.php');
$cl = new SphinxClient();
$cl->SetServer( "localhost", 3312 );
$cl->SetMatchMode( SPH_MATCH_ANY );
$cl->SetFilter( 'model', array( 3 ) );
$result = $cl->Query( 'cylind


Ïà¹ØÎĵµ£º

¹ØÓÚPHP VC9,VC6,Thread Safe,Non Thread Safe

Ò»¡¢ÈçºÎÑ¡Ôñ PHP5.3 µÄ VC9 °æ±¾ºÍ VC6 °æ±¾
VC6 °æ±¾ÊÇʹÓà Visual Studio 6 ±àÒëÆ÷±àÒëµÄ£¬Èç¹ûÄãµÄ PHP ÊÇÓà Apache À´¼ÜÉèµÄ£¬ÄÇÄã¾ÍÑ¡Ôñ VC6 °æ±¾¡£
VC9 °æ±¾ÊÇʹÓà Visual Studio 2008 ±àÒëÆ÷±àÒëµÄ£¬Èç¹ûÄãµÄ PHP ÊÇÓà IIS À´¼ÜÉèµÄ£¬ÄÇÄã¾ÍÑ¡Ôñ VC9 °æ±¾¡£
¶þ¡¢ÈçºÎÑ¡Ôñ PHP5.3 µÄ Thread Safe ºÍ Non Thread S ......

phpÔ¶³Ì»ñȡͼƬ

<?php
//
// Function: »ñÈ¡Ô¶³ÌͼƬ²¢°ÑËü±£´æµ½±¾µØ
//
//
// È·¶¨ÄúÓаÑÎļþдÈë±¾µØ·þÎñÆ÷µÄȨÏÞ
//
//
// ±äÁ¿ËµÃ÷:
// $url ÊÇÔ¶³ÌͼƬµÄÍêÕûURLµØÖ·£¬²»ÄÜΪ¿Õ¡£
// $filename ÊÇ¿ÉÑ¡±äÁ¿: Èç¹ûΪ¿Õ£¬±¾µØÎļþÃû½«»ùÓÚʱ¼äºÍÈÕÆÚ
// ×Ô¶¯Éú³É.
function GrabImage($url,$filename="") { ......

PHP֪ʶ»ýÀÛ

1 ÔÚSQLÓï¾äÖпÉͨ¹ýÌí¼ÓÏÞÖÆÌõ¼þ:left(text,20)ֻȡtextÎı¾µÄÇ°20¸ö×Ö;
¡¡¡¡2 ¿ÉÒÔÓÃlimit fromRecord, RecordNum À´×÷Ϊ·ÖҳʹÓÃ,±ÈÈçlimit 0,30±íʾ´ÓµÚÒ»¸ö¼Ç¼¿ªÊ¼±éÀú30¸ö¼Í¼;
¡¡¡¡3 Á½¸ö±íµÄÁ¬½Ó¿ÉÒÔÊÇ£ºtable1 join table2 using x(xΪÁ½¸ö±íµÄ¹«¹²×Ö¶Î),»òÕßÊÇtable1 join table2 on table1.x = table2.x
¡¡¡ ......

PHPÊý×Ö¼ÓÃܽâÃÜÀà

<?php
/* ----------------------------------------------------------------------------
* Script Name: encrypt.php
* Creation Date: 2008-4-7 10:36
* Last Modified: 2008-4-12 16:00
* Author: meyu
* Copyright (c) 2007
* Purpose: Êý×Ö×Ö·û´®¼òÒ×¼Ó½âÃÜ
* --------------------------------- ......

PHP Éú³ÉËæ»úÊý

function randomkeys($length)
{
 $key='';
 $pattern='123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
 for($i=0;$i<$length;$i++)
 {
   $key .= $pattern{mt_rand(0,47)}; 
       
  }
   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ