velvetInk velvetInk - 4 months ago 10
PHP Question

how to change the value number to a word

I need to display true or false not the number 1

$permission === 1 ? true: false

Answer

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"

Comments