<?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'])
{
}
0
A
回答
0
嘗試這樣的..
<?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))
{
}
相關問題
- 1. Imagettftext不能與wordwrap /爆炸
- 2. 如何爆炸數組值
- 3. Shiro爆炸與數據庫會話啓用
- 4. 如何使用列值爆炸?
- 5. 數字ID後爆炸
- 6. 從爆炸url獲取ID
- 7. PHP。如何爆炸•
- 8. `json_encode`不能用於爆炸
- 9. 爆炸數組值
- 10. 爆炸下拉值
- 11. 如何使用爆炸
- 12. 爆炸()困惑我
- 13. 檢查是否值爆炸數組被複制與其他爆炸值
- 14. 如何使用PHP爆炸功能和插入值到MySQL
- 15. jquery - 如何爆炸數組值
- 16. 爆炸的字符串與鍵=>值
- 17. 爆炸功能對我無效?
- 18. 我如何與員工ID匹配SQL
- 19. 我如何在「,」在PHP中爆炸?
- 20. 如何向我的SKSpriteNode添加爆炸?
- 21. 由任何塊內的最後一個匹配字符爆炸
- 22. 如何選擇會話用戶的匹配值的非激情用戶在PHP
- 23. 陣列爆炸,每行匹配/使用錶行
- 24. 蜂房爆炸功能
- 25. NVD3餅圖爆炸功能
- 26. 爆炸功能的textarea
- 27. 如何使爆炸()包括爆炸字符
- 28. SparkSQL第二爆炸的第一爆炸
- 29. 如何爆炸php結果
- 30. 如何爆炸色譜柱?
使用in_array()函數可能會得到一些幫助 –
使用in_array($ _ SESSION [ 'USER_ID'],$ imp_to)或in_array($ _ SESSION [ 'USER_ID' ],$ imp_cc) – WisdmLabs
規範化數據庫。 – symcbean