©
本文档使用 PHP中文网手册 发布
(PECL sphinx >= 0.1.0)
SphinxClient::escapeString — Escape special characters
$string
)Escapes characters that are treated as special operators by the query language parser.
string
String to escape.
Returns escaped string.
[#1] xxxbunker dot com [2010-03-14 08:12:03]
according to http://www.sphinxsearch.com/forum/view.html?id=5225:
this function doesn't really do what one would expect (mysql_real_escape_string style) and is more meant to escape individual keywords...
my experience it works better to manually escape reserved characters, for example:
<?php
$string='make big $ online';
$escaped=str_replace('$','\\$',$string);
?>