StringVal()
Validates whether the input can be used as a string.
v::stringVal()->isValid('6'); // true
v::stringVal()->isValid('String'); // true
v::stringVal()->isValid(1.0); // true
v::stringVal()->isValid(42); // true
v::stringVal()->isValid(false); // true
v::stringVal()->isValid(true); // true
v::stringVal()->isValid(new ClassWithToString()); // true if ClassWithToString implements `__toString`| Mode | Template |
|---|---|
default |
{{subject}} must be a string value |
inverted |
{{subject}} must not be a string value |
| Placeholder | Description |
|---|---|
subject |
The validated input or the custom validator name (if specified). |
- Strings
- Types
| Version | Description |
|---|---|
| 2.0.0 | Created |
See also: