Documentation

Tags_prepare

array
tags_prepare(
string sText,
string site_id = false
);

Function splits text per separate tags and returns an array. Split occurs by the symbol "," (comma). After that, the [link=6657584]OnSearchGetTag[/link] event handler is called for each tag. If the result is not empty, the tag will be included into the index.

Function parameters

Parameter Description
sText Contains text for splitting per tags.
site_id Site ID.

Returned value

Function returns an array of tags.

See Also

  • [link=6657584]OnSearchGetTag[/link]

Examples of use

<?
$ar = tags_prepare("apache, Web 2.0, AJAX", "s1");
print_r($ar);

//Will be printed:
/*
array(
"apache" => "apache"
"Web 2.0" => "Web 2.0"
"AJAX" => "AJAX"
)
*/
?>


© «Bitrix24», 2001-2024
Up