Assigning data to a variable that has a lot of white space in the beginning, I then do a trim to remove it and want to echo the first character which should be @. However, the echo displays nothing.
$data = ' @ JWHS8282';
trim($data);
echo $data[0];
Trim doesn’t accept a parameter by reference:
It is defined as:
NOT
Note that the docs mark the signature of trim as returning a string: