Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は2本の弦を持っています
$string1 = 'Amateur developer | Photoshop lover| Alcohol scholar | Internet practitioner';
と
$string2 = 'Amateur developer | Photoshop lover| Alcohol scholar';
PHPこれら 2 つの文字列を特殊文字 (スペースとハイフン) を間に挟んで比較するにはどうすればよいですか?
PHP
Case と比較してみてください。
$result = strcmp($string1, $string2);
Case to consier なしで比較するには、これを試してください。
$result = strcasecmp($string1, $string2);
$result が 0(ゼロ) の場合、文字列は等しくなります。
これを試して