What is the best way to evaluate two variables that contain strings? For example, I want to compare if "a black truck" and "A Black Truck" are both the same thing.
ljCharlie
How to evaluate string?
Moderator: General Moderators
Code: Select all
<?php
$str1 = 'A BlACk TruCk';
$str2 = 'a black TRUCK';
if (strtolower($str1) === strtolower($str2)) {
// they are the same
}
?>