Skip to content

searchStr

Corey Avis edited this page Sep 23, 2026 · 2 revisions

searchStr [Protected]

A manual formatting helper that applies the necessary wildcards to a search term.

Usage

searchStr(string $str, string $op = '%'): string

Parameters

str (string) : The string to format.

op (string) : The search operator. (default: '%') ^(optional)^

Operator Description
% Search ('%search%')
=% Starts with ('search%')
%= Ends with ('%search')

Return Value

(string) : Returns the formatted search string.

Examples

$db->searchStr('term') = %term%
$db->searchStr('term', '=%') = term%
$db->searchStr('term', '%=') = %term

Debug Errors

  • No debug errors.

Related Methods

sqlEscape | sqlWrap


Home | CoreyDB | Helpers

Clone this wiki locally