BRADERY Posted February 17, 2011 Share Posted February 17, 2011 <?php $a = 2; $b = 3; $z = fopen("test.txt", 'a+'); if($a > $b) { echo "A is bigger than B"; } elseif fwrite($z, $b); fclose($z); ?> is there a way to get elseif to write to a file? so if b is bigger than a it writes $b to a file? Link to comment https://forums.phpfreaks.com/topic/227991-elseif-write-to-file-possible/ Share on other sites More sharing options...
BlueSkyIS Posted February 17, 2011 Share Posted February 17, 2011 else if (what?) can you just use else? if($a > $b) { echo "A is bigger than B"; } else { fwrite($z, $b); } Link to comment https://forums.phpfreaks.com/topic/227991-elseif-write-to-file-possible/#findComment-1175639 Share on other sites More sharing options...
BRADERY Posted February 17, 2011 Author Share Posted February 17, 2011 ahh shit, Lol.. Thanks. Link to comment https://forums.phpfreaks.com/topic/227991-elseif-write-to-file-possible/#findComment-1175642 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.