Co přesně ti není jasné?Funkce na hledaní je asi takto:if (strpos($vstup,"[GALERY=5]")) {echo "id5";}