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" "false"
, not "0" "1"
$converted_res = "true";
$converted_res = "false";
I've tried:
$converted_res = string($res);
$converted_res = String($res);
But it tells me that string
and String
are not recognized functions.
How do I convert this Boolean to a string in the format of "true"
or "false"
in PHP?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…