add brackets to string php 1

add brackets to string php

$withbrackets = '[' . $strName . ']';

Here is what the above code is Doing:
1. It’s creating a string variable called $strName.
2. It’s creating a string variable called $withbrackets.
3. It’s assigning the value of $strName to $withbrackets, but with brackets around it.

Similar Posts