如何将分解值与用户会话 ID 匹配


how can i match exploded value with user session id?

<?php while($row=mysql_fetch_array($res)) { 
     $imp_to=explode(',',$row['mail_to_user_id']);
     $imp_cc=explode(',',$row['mail_cc_user_id']);
if($imp_to == $_SESSION['user_id'] or $imp_cc == $_SESSION['user_id'] )
    {
    }

试试这样。

<?php while($row=mysql_fetch_array($res)) { 
     $imp_to=explode(',',$row['mail_to_user_id']);
     $imp_cc=explode(',',$row['mail_cc_user_id']);
    if(in_array($_SESSION['user_id'] ,$imp_to) || in_array($_SESSION['user_id'] ,$imp_cc))
    {
    }