I have this string :
[{"type":"date","label":"Champ Date de ","className":"form-control","name":"date-1545926599900"}]
I need to delete the last space from the label, the actual value is "Champ Date de " i need to convert it as "Champ Date de".
Here my actual code :
$form = str_replace('\n','',$request->getParameter('data'));
$form = str_replace('\t','',$form);
$form = str_replace(' ','',$form);
$form = str_replace('<br>','',$form);
var_dump($form); die;
The problem come from the
: str_replace('<br>','',$form);
with
i have no problem and the function str_replace do not add a space. but with <br>
the str_replace add a space add i really need to have any space at the end of this value. hope someone could help.
I could have multiple array :
'[{"type":"date","label":"Champ Date de ","className":"form-control","name":"date-1545929424866"},{"type":"checkbox-group","label":"You like it ? ","name":"checkbox-group-1545929428281","values":[{"label":"Option 1","value":"1","selected":true}]}]'
` – aynber Dec 27 '18 at 16:29