小编rit*_*itu的帖子

比较字符串

<?php
    $string1 = "12 jan";
    $string2 = "12 aprail, 13 march";
    $result = strcmp($string1, $string2);

    switch ($result) {
        case -1: print "date are not identical"; break;
        case 0: print "date1"; break;
        case 1: print "date are identical"; break;
    }
?>
Run Code Online (Sandbox Code Playgroud)

当我使用这个代码时,它会告诉我一个日期是相同的甚至是值ex当我比较值12月1日到12月3日它会显示我的价值是相同但价值是不同的

php string comparison

2
推荐指数
1
解决办法
226
查看次数

标签 统计

comparison ×1

php ×1

string ×1