Why do two array values look the same, but don't evaluate as equal?

Posted by kevtrout on Stack Overflow See other posts from Stack Overflow or by kevtrout
Published on 2010-04-15T12:38:25Z Indexed on 2010/04/15 12:43 UTC
Read the original article Hit count: 115

Filed under:
|
|
|

When I compare two array values I see two strings that look the same. php doesn't agree.

$array1 = ('address'=>'32 Winthrop Street','state'=>'NY');
$array2 = ('address'=>'32 Winthrop Street');

$results = array_diff_assoc('$array1, $array2);

var_dump($results) 
//echos ['address'] => string(18) "32 Winthrop Street" ['state']=>'NY'

Why is this?

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays