How to Convert Boolean to String

后端 未结 15 748
死守一世寂寞
死守一世寂寞 2020-11-28 02:43

I have a Boolean variable which I want to convert to a string:

$res = true;

I need the converted value to be of the format: \"true\"

15条回答
  •  离开以前
    2020-11-28 03:19

    Just wanted to update, in PHP >= 5.50 you can do boolval() to do the same thing

    Reference Here.

提交回复
热议问题