problem with if statement used to determine function return
        Posted  
        
            by Patrick
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Patrick
        
        
        
        Published on 2009-12-03T22:33:12Z
        Indexed on 
            2010/04/07
            1:23 UTC
        
        
        Read the original article
        Hit count: 412
        
Im using an if statement to determine what to return in a function, but it seems to be not working the way i want it to.
function DoThis($dogs, $cats){
// do something with dogs, pet them perhaps.
$reg = $dogs[0];
$nate = $dogs[1];
if($cats = "dave"){return $reg;}
if($cats = "tom"){return $nate;}
}
$cats is a string (if that helps), and when entered it doesn't yield any return.
If i manually set a return, that works, but the above doesnt for some reason.
© Stack Overflow or respective owner