php associative array username first letter

$array=array("sam"=>"andy");
$user="sam";
$pass="andy";
if(!in_array($user,$array)) //line no 5
    {
        echo "please register";

    }
else 
    {
        if($array[$user]==$pass)
            {
                echo "welcome";
            }
  }

What changes should i do in line no 5 so user will be “sam” not “sam=>andy”??

For more info please click herehttps://stackoverflow.com/q/49220303

Have a question or need a custom quote?
info@smartinfocare.com