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" 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); 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? 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? 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 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. 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 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 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
Archived
This topic is now archived and is closed to further replies.