plznty Posted May 30, 2009 Share Posted May 30, 2009 <?php $my_name = file_get_contents("./txt.txt"); if ( $my_name == "crap" ) { echo "Dont swear, you said $my_name<br />"; }; ?> txt.txt file contents has the word "crap" Quote Link to comment https://forums.phpfreaks.com/topic/160314-solved-file-get-contents-problem-with-ifs/ Share on other sites More sharing options...
Ken2k7 Posted May 30, 2009 Share Posted May 30, 2009 Why not just print out $my_name to verify that? var_dump($my_name); Quote Link to comment https://forums.phpfreaks.com/topic/160314-solved-file-get-contents-problem-with-ifs/#findComment-845988 Share on other sites More sharing options...
plznty Posted May 31, 2009 Author Share Posted May 31, 2009 is isnt echoing the part even though both sides match. Probs a error in getting the file contents? Quote Link to comment https://forums.phpfreaks.com/topic/160314-solved-file-get-contents-problem-with-ifs/#findComment-845991 Share on other sites More sharing options...
Ken2k7 Posted May 31, 2009 Share Posted May 31, 2009 What was the output of var_dump? Quote Link to comment https://forums.phpfreaks.com/topic/160314-solved-file-get-contents-problem-with-ifs/#findComment-845994 Share on other sites More sharing options...
plznty Posted May 31, 2009 Author Share Posted May 31, 2009 What was the output of var_dump? Where shall i put it Quote Link to comment https://forums.phpfreaks.com/topic/160314-solved-file-get-contents-problem-with-ifs/#findComment-845995 Share on other sites More sharing options...
Ken2k7 Posted May 31, 2009 Share Posted May 31, 2009 Wherever make sense to you. You only have 6 lines to choose from. Quote Link to comment https://forums.phpfreaks.com/topic/160314-solved-file-get-contents-problem-with-ifs/#findComment-845999 Share on other sites More sharing options...
plznty Posted May 31, 2009 Author Share Posted May 31, 2009 Doesnt display Quote Link to comment https://forums.phpfreaks.com/topic/160314-solved-file-get-contents-problem-with-ifs/#findComment-846007 Share on other sites More sharing options...
plznty Posted May 31, 2009 Author Share Posted May 31, 2009 Oh sorry, displayed on my xamp just not a friends. solved Quote Link to comment https://forums.phpfreaks.com/topic/160314-solved-file-get-contents-problem-with-ifs/#findComment-846008 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.