在PHP中,可以使用雙等號(==)或三個等號(===)來判斷兩個字符串是否相等。
$str1 = "Hello";
$str2 = "hello";
if ($str1 == $str2) {
echo "Strings are equal";
} else {
echo "Strings are not equal";
}
$str1 = "Hello";
$str2 = "hello";
if ($str1 === $str2) {
echo "Strings are equal";
} else {
echo "Strings are not equal";
}