How to trim multiple characters at begin and end of string. string should be something like {Hello {W}orld}. i want to trim both { and }<
{Hello {W}orld}
{
}<
$str = "{Hello {W}orld}"; $str = trim($str, "{}"); echo "Trimmed: $str";