PHP: Case-insensitive “array_diff”

前端 未结 2 1135
北海茫月
北海茫月 2021-02-07 07:35

I have following two arrays and the code to find array_diff:

$obs_ws = array(\"you\", \"your\", \"may\", \"me\", \"my\", \"etc\");
$all_ws = array(\"LOVE\", \"Wo         


        
2条回答
  •  再見小時候
    2021-02-07 08:06

    Try to pass strcasecmp as third parameter to array_udiff function:

    Output:

    Array
    (
        [0] => LOVE
        [1] => World
        [5] => CoDe
    )
    

提交回复
热议问题