php curly brackets elements in string code example Example: add brackets to string php $withbrackets = '[' . $strName . ']';