Home > Backend Development > PHP Tutorial > php简单判断两个字符串是否相等的方法

php简单判断两个字符串是否相等的方法

PHPz
Release: 2018-10-11 16:56:51
Original
2624 people have browsed it

这篇文章主要介绍了php简单判断两个字符串是否相等的方法,涉及php针对字符串操作的相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下

<?php 
function strcomp($str1,$str2){ 
  if($str1 == $str2){ 
    return TRUE; 
  }else{ 
    return FALSE; 
  } 
} 
echo strcomp("First string","Second string");
//Returns FALSE 
echo strcomp("A string","A string");
//Returns TRUE 
?>
Copy after login

更多相关教程请访问 php编程从入门到精通全套视频教程

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template