redarrow Posted October 22, 2008 Share Posted October 22, 2008 brocken down if (isset (strcmp(0 //<<< set strcmp to a 0..... ,$_POST['submit'] // if strchmp is 0 .... ) ===0)){ // post is 0 echo message............ echo correct; } This is the correct way to format or write strcmp ((does not work)) <?php if(isset(strcmp(0,$_POST['submit'])===0)){ echo correct; } ?> This is the incorrect way but works WHY ((works)) <?php if(isset(strcmp(0,$_POST['submit']===0))){ echo correct; } ?> Link to comment https://forums.phpfreaks.com/topic/129525-solved-strcmp-exsplenation-wanted-please-example-added/ Share on other sites More sharing options...
redarrow Posted October 22, 2008 Author Share Posted October 22, 2008 example this should not be done as the strcmp is not being used $p=0; if(strcmp(0,$p===0)){ echo correct; } This errors but the exsprision is correct......... $p=0; if(strcmp(0,$p)===0))){ echo correct; } Link to comment https://forums.phpfreaks.com/topic/129525-solved-strcmp-exsplenation-wanted-please-example-added/#findComment-671560 Share on other sites More sharing options...
redarrow Posted October 22, 2008 Author Share Posted October 22, 2008 SOLVED sorry my fault ............. <?php //example 1 with strcmp... $p=0; if((strcmp(0,$p)===0)){ echo correct; } //example 2 of post with strcmp..... if( (isset($_POST['submit']) && (strcmp(0,$_POST['submit'])===0)) ){ echo correct; } ?> Link to comment https://forums.phpfreaks.com/topic/129525-solved-strcmp-exsplenation-wanted-please-example-added/#findComment-671563 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.