作者o500521 (poet)
看板PHP
標題[請益] 符合多個條件 就顯示圖片
時間Wed Apr 18 21:11:18 2012
大家好
$row = "(2S)-2-Methylacyl-CoA" ;
$r1 = similar_text($keyword,$row,$r2);{
if ( ereg ("(.+)ane(.+)", $keyword ) )
if ($r2>$simile) ;
?> <table width="200" border="1">
<tr><td> Catalysis Enzyme:phosphoglucose mutase </td></tr>
<tr><td><P ALIGN="center"><IMG SRC="(2S)-2-Methylacyl-CoA
2-epimerase@ (2S)-2-Methylacyl-CoA.gif"></P>;</td></tr>
</table><?php }
條件一 ;if ( ereg ("(.+)ane(.+)", $keyword ) )
條件二 ;if ($r2>$simile)
顯示圖片;<table width="200" border="1">
<tr><td> Catalysis Enzyme:phosphoglucose mutase </td></tr>
<tr><td><P ALIGN="center"><IMG SRC="(2S)-2-Methylacyl-CoA
2-epimerase@ (2S)-2-Methylacyl-CoA.gif"></P>;</td></tr>
</table>
小弟希望我輸入的東西 當符合一跟二時 就顯示圖片 可是
一直沒辦法 想請問大大 我該怎麼做呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.100.144
1F:推 kerash:版本不會太舊的話 ereg 先改成 preg_match 吧 04/18 21:13
2F:→ MOONRAKER:為何你 { } ; 的位置看來這麼奇妙 04/18 22:55
3F:→ buganini:{}位置不對 if()後面多了分號 04/20 12:17