User attribute not comparing to string successfully.
Permalink
I am having users store data on sign up. Later, I am putting that data using:
When I compare this (on this user, it is stored as "English Adult Male") to a string literal, it doesn't succeed. The string literal is 18 characters, a var_dump of the variable shows it's 23. It looks like it ends in a space with a carriage return. I have tried to use the 'trim" function, but it still returns 23 characters.
Is there something about the data being stored in concrete5 that I need to know to get this condition to test true?
use Concrete\Core\User\UserInfo; $u = new User(); $ui = UserInfo::getByID($u->getUserID()); $testtype = $ui->getAttribute('TestType','display');
When I compare this (on this user, it is stored as "English Adult Male") to a string literal, it doesn't succeed. The string literal is 18 characters, a var_dump of the variable shows it's 23. It looks like it ends in a space with a carriage return. I have tried to use the 'trim" function, but it still returns 23 characters.
Is there something about the data being stored in concrete5 that I need to know to get this condition to test true?
What you want to do is