This code some times returns FALSE, but I want a TRUE result

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
danf_1979
Forum Commoner
Posts: 72
Joined: Sun Feb 20, 2005 9:46 pm

This code some times returns FALSE, but I want a TRUE result

Post by danf_1979 »

Code: Select all

print_f("Make this year your life better than ever. If you're going through difficult times, try to learn from your experience. Nothing happens for no reason. Life is more than you can see. If you got everything but love, then, what do you have? You can change your life thinking a different way. I dont know you, but I do love you. You can love anyone too.");
Happy new year guys! God bless you!
mickd
Forum Contributor
Posts: 397
Joined: Tue Jun 21, 2005 9:05 am
Location: Australia

Post by mickd »

printf doesnt return true or false. does it?

if this thread was just to say happy new year, it should of been in the general section ;) anyways, happy new year to you too.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

print_f returns an integer, so if you print_f(''), you'll get 0 == false.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

Code: Select all

function always_true() {
     return((bool)print_f("Make this year your life better than ever. If you're going through difficult times, try to learn from your experience. Nothing happens for no reason. Life is more than you can see. If you got everything but love, then, what do you have? You can change your life thinking a different way. I dont know you, but I do love you. You can love anyone too.")); 
}

there, that oughtta do it
Post Reply