Jump to content

[SOLVED] strcmp exsplenation wanted please example added


redarrow

Recommended Posts

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;

}
?>

 

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;

}

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;
   
}


?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.