downloads | documentation | faq | getting help | mailing lists | reporting bugs | sites | links | my 
search for in the  
Last updated: Mon, 16 Jul 2012


(PHP 4 >= 4.0.5, PECL)

yaz_ccl_parse -- Invoke CCL Parser


bool yaz_ccl_parse ( resource id, string query, array &result )

This function invokes a CCL parser. It converts a given CCL FIND query to an RPN query which may be passed to the yaz_search() function to perform a search.

To define a set of valid CCL fields call yaz_ccl_conf() prior to this function.



The connection resource returned by yaz_connect().


The CCL FIND query.


If the function was executed successfully, this will be an array containing the valid RPN query under the key rpn.

Upon failure, three indexes are set in this array to indicate the cause of failure:

  • errorcode - the CCL error code (integer)

  • errorstring - the CCL error string

  • errorpos - approximate position in query of failure (integer is character position)


如果成功则返回 TRUE,失败则返回 FALSE

例子 1. CCL Parsing

We will try to search using CCL. In the example below, $ccl is a CCL query.


($id, $fields);  // see example for yaz_ccl_conf
if (!yaz_ccl_parse($id, $ccl, &$cclresult)) {
'Error: ' . $cclresult["errorstring"];
} else {
$rpn = $cclresult["rpn"];
yaz_search($id, "rpn", $rpn);

 Last updated: Mon, 16 Jul 2012
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at:
Last updated: Thu Jul 7 19:13:47 2005 CST