bool
This function converts a value to a voolean value.
Vectorization: This function supports vectorization in the 1st function parameter.
Instead of providing a single value, you can provide a set or even a nested set which contain multiple values.
The function will then process every value and its return value contains a corresponding set containing all results.
Indirect parameter passing is disabled
Vectorization is allowed in the 1st function parameter
1
No. | Type | Description |
---|---|---|
1 input |
valid types | Value Strings returning true:true, yes, '1' (not case sensitive, and also in other supported languages) |
Type | Description |
---|---|
boolean set |
Result Identified boolean value. A set containing multiple values is returned if vectorization is used. |
echo( bool(TRUE), " ", bool(Falsch) ); // true, false
echo( bool("Ja"), " ", bool("No") ); // true, false
echo( bool("1"), " ", bool(0) ); // true, false
echo( bool({{Yes,Ja},{No,Nein}} ) ); // Vectorization: {{true,true},{false,false}}
echo( bool( { date( '10:30:00' ), date("") } ) ); // true, fasle
true false
true false
true false
{{true,true},{false,false}}
{true,false}