php condition (IN DIFFERENT VALUE)
if $tt > 29 print Good , if $tt < 55 print Very good but when $tt= less than 0 print very bad in php
<?php
if( $tt > 29 ) {
print "Good";
} else if( $tt > 29 && $tt < 55) {
print "Very Good";
} else if( $tt < 0) {
print "Very bad";
}
?>
Your question has too may loopholes and few numbers are overlapping your conditions and few are comming in no condition.
So here is a code which will print
You can chenge number based on your needs
<?php
if( $tt <= 0 ) {
echo "Very Bad";
} else if( $tt <= 29) {
echo "Bad";
} else if( $tt <= 55) {
echo "Good";
} else {
echo "Very Good";
}
?>
Here you go
<?php
if( $tt > 29 ) {
echo "Greater Than 29 ";
} else if( $tt > 29 && $tt < 55) {
echo "Greater Than 29 and less than 55 ";
} else if( $tt < 0) {
echo "less than zero ";
}
?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.