Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

compare strings with if statement in php

Sun Oct 26, 2008 10:37 pm

Code:
<html>
<body>
<?php
     $str_ctrl_flow 
"hey";
   
     if(!
strcmp($str_ctrl_flow"hey")) {
          print(
"string is \"hey\"<br />");
     } else {
          print(
"Time to wait<br />");
          exit;
     }
   
     
$str_ctrl_flow "wait";
   
     if(!
strcmp($str_ctrl_flow"hey")) {
          print(
"string is \"hey\"<br />");
     } else {
          print(
"Time to wait<br />");
          exit;
     }
?>
</body>
</html>




Post a reply
  Related Posts  to : compare strings with if statement in php
 compare two strings     -  
 compare strings     -  
 Compare two strings in php     -  
 Sort strings java-Sorting Array of Strings     -  
 difference between break statement and a continue statement     -  
 difference between a while statement and a do statement     -  
 Compare directories     -  
 compare two sets     -  
 String compare equality     -  
 Use the boolean compare operators     -  

Topic Tags

PHP Strings