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