Reputation: 368
I need to display true or false not the number 1
$permission === 1 ? true: false
Upvotes: 0
Views: 45
Reputation: 771
Its as simple as
echo "Output : ".($permission == 1) ? 'true': 'false';
Upvotes: 0
Reputation:
nearly right:
$permission= ($permission === 1) ? 'true': 'false';
echo $permission;
http://php.net/manual/en/language.operators.comparison.php
First you dont make any assignment =
then you have to make a comparison $permission === 1
then you want the string values "true"
or "false"
Upvotes: 1
Reputation: 5008
change the boolean to string value
$permission === 1 ? 'true': 'false';
Upvotes: 0