String compare with if statement : String Compare : String PHP Source Code


PHP Source Code » String » String Compare »

 

String compare with if statement



<html>
<head>
<title>Decisions</title>
</head>
<body>
<?php
     $str_ctrl_flow = "go";
   
     if(!strcmp($str_ctrl_flow, "go")) {
          print("string is "go"<br />");
     else {
          print("Time to stop<br />");
          exit;
     }
   
     $str_ctrl_flow = "stop";
   
     if(!strcmp($str_ctrl_flow, "go")) {
          print("string is "go"<br />");
     else {
          print("Time to stop<br />");
          exit;
     }
?>
</body>
</html>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo String
» String Compare