php function to find a text inside curly brackets in a string code example Example: add brackets to string php $withbrackets = '[' . $strName . ']';