PHP Doku:: Escape special characters - sphinxclient.escapestring.html

Verlauf / Chronik / History: (7) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSuchmaschinenerweiterungenSphinx ClientThe SphinxClient classSphinxClient::escapeString

Ein Service von Reinhard Neidl - Webprogrammierung.

The SphinxClient class

<<SphinxClient::__construct

SphinxClient::getLastError>>

SphinxClient::escapeString

(PECL sphinx >= 0.1.0)

SphinxClient::escapeStringEscape special characters

Beschreibung

public string SphinxClient::escapeString ( string $string )

Escapes characters that are treated as special operators by the query language parser.

Parameter-Liste

string

String to escape.

Rückgabewerte

Returns escaped string.


Ein BenutzerBeitrag:
- Beiträge aktualisieren...
xxxbunker dot com
14.03.2010 17:12
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);
?>



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)