
Table of Contents
PHP is the language SearchMonkey supports for mapping your XML data to your application's various visual components, such as the title, summary, thumbnail, and links. This section provides more background about how to use PHP to extract and display search data. It includes:
“SearchMonkey PHP Whitelist” — lists the subset of PHP classes and functions permitted for extracting and mapping data in SearchMonkey
“The Data Class” — describes the Data
class, an instantiation of the XML returned by your data services
For a detailed example of using PHP to write a SearchMonkey application, refer to “Creating a Presentation Application”. For documentation about the associative array used to construct applications, refer to “Presentation Application PHP Structure”.
![]() |
Note |
|---|---|
All user PHP code is run inside a class. If you write your own
functions, you must call them using |
SearchMonkey supports a limited subset of PHP for mapping data to your presentation application. SearchMonkey's PHP functionality includes classes and functions designed to:
manipulate the DOM
manipulate strings
manipulate dates
manipulate arrays
execute regular expressions
perform operations on variables
perform mathematical operations
encode and decode JSON data
and more.
All language constructs except the
backtick operator, alias to shell_exec(), are
available. Note that __FILE__ and __DIR__ return
a value without an error, but the value they return is an empty string.
You cannot read or write to the filesystem, access network sockets, or
execute processes.
preg_grep |
preg_replace_callback |
eregi_replace |
preg_last_error |
preg_replace |
eregi |
preg_match_all |
preg_split |
split |
preg_match |
ereg_replace |
spliti |
preg_quote |
ereg |
sql_regcase |