sylunt1 Posted July 14, 2006 Share Posted July 14, 2006 Greetings:I have a hopefully simple question.What I want to do is this... If a date is 9999-12-12 then print a "-" - this part I have and it works fine. But what I want to do is add a 2nd condition - if upgrade = 0 then use a different font. I am not sure how to add another condition without printing the whole line again.Any help would be appreciated.[code]if ($exp_date == "December 31, 9999"){print '<table border="0" width="80%" cellspacing="0" cellpadding="0">'; echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">-</td></tr></table>';}else{print '<table border="0" width="80%" cellspacing="0" cellpadding="0">'; echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">' . $exp_date . '</td></tr></table>'; } [/code] Quote Link to comment https://forums.phpfreaks.com/topic/14620-multiple-conditions/ Share on other sites More sharing options...
redarrow Posted July 14, 2006 Share Posted July 14, 2006 $echo_table1='<table border="0" width="80%" cellspacing="0" cellpadding="0">'; echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">-</td></tr></table>';$echo_table2='<table border="0" width="80%" cellspacing="0" cellpadding="0">'; echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">' . $exp_date . '</td></tr></table>';if ($exp_date == "December 31, 9999") {echo $table1;}else{echo $table2; }elseif($upgrade=="0"){str_replace(" '\ .\ $lic_num \.\ '\.\rtf\", "what_ever.rtf", $table1);echo $table1;}else{str_replace(" '\.\ $lic_num\ .\ '\.\rtf\", "what_ever.rtf", $table2);echo $table2;}good starting point anyway. Quote Link to comment https://forums.phpfreaks.com/topic/14620-multiple-conditions/#findComment-58179 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.