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

Compare two strings in php

Sun Oct 26, 2008 10:34 pm

Code:
<?
$str1 
"00009";
$str2 "003";
$str3 "00009-CODEMILES";

if (
$str2 $str1){
  print(
"$str2 is less than $str1<BR>");
}

if (
$str3 $str2){
  print(
"$str3 is less than $str2<BR>");
}
if (
$str1 $str3){
  print(
"$str1 is less than $str3<BR>");
}
?>




Post a reply
  Related Posts  to : Compare two strings in php
 compare strings     -  
 compare two strings     -  
 compare strings with if statement in php     -  
 Sort strings java-Sorting Array of Strings     -  
 Compare directories     -  
 compare two sets     -  
 String compare equality     -  
 How to compare two arrays in java     -  
 Use the boolean compare operators     -  
 Integer value compare with equal sign     -  

Topic Tags

PHP Strings