strcmp
string string
strcmp は「元に戻す」が不可能、「照会」が不可能、「編集」が不可能です。
string 型の引数 2 つを辞書的に比較します。第 1 の引数が第 2 の引数に比べて小さいか、同じか、大きいかによって、0 より小さい整数、0、0 より大きい整数のどれかを返します。int | 比較値 |
string $s1="hello"; string $s2="goodbye"; int $compare = `strcmp $s1 $s2`; // Result: 1 // $compare = `strcmp $s2 $s1`; // Result: -1 // $compare = `strcmp "hello" $s1`; // Result: 0 //