echo $bool_val ? 'true' : 'false';
Or if you only want output when it’s false:
echo !$bool_val ? 'false' : '';
More Related Contents:
- Perform logic operations on boolean array values
- PHP in_array() / array_search() odd behaviour
- mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in [duplicate]
- How to convert string to boolean php
- PHP printed boolean value is empty, why?
- boolean variables posted through AJAX being treated as strings in server side
- Something wrong with PHP
- How to echo something outside of function?
- How do I explode() these variables?
- IP addresses in PHP
- PHP Sort a multidimensional array by element containing Y-m-d H:i:s date
- tags not working in php 5.3.1
- How can I use a JavaScript variable as a PHP variable? [duplicate]
- Convert string to binary then back again using PHP
- Using Default Arguments in a Function
- Insert query on page load, inserts twice?
- Not equal to != and !== in PHP
- Xampp Access Forbidden php
- line breaks in a textarea
- How to output JavaScript with PHP
- Set timezone in PHP and MySQL
- Continue processing after closing connection [duplicate]
- Guzzle: handle 400 bad request
- PHP on Windows with XAMPP running 100 times too slow
- Getting PEAR to work on XAMPP (Apache/MySQL stack on Windows)
- PHP day of week numeric to day of week text
- Getting a list of files by folder on Drive SDK
- How do you rename a tag in SimpleXML through a DOM object?
- Any way to break if statement in PHP?
- mysql_connect VS mysql_pconnect [closed]