Zurev Posted January 13, 2011 Share Posted January 13, 2011 foreach ($export as $group => $arrayOpts) { //echo $arrayOpts[0]["choice"]; This returns No /** * If the option hasn't been selected, leave that part out entirely **/ if (!empty($arrayOpts)) // if the entire options array isn't empty, we'll display { if ($arrayOpts[0]["choice"]!="0" || $arrayOpts[0]["choice"]!="No") { $pdf->Cell(40,10,$group,0,1); $pdf->ImprovedTable($header,$arrayOpts); $pdf->Ln(); } } } Unfortunately I can't show print_r's at the moment, the main issue is it's running those $pdf-> lines even if that variable is equal to No, I proved it because up above commented out returns No, but it still runs the pdf code. Any thoughts? Been staring at it a while, maybe it's something in my conditional statement? Thanks. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 13, 2011 Share Posted January 13, 2011 Presuming you don't want the value to be either zero or 'no': if ($arrayOpts[0]["choice"]!="0" && $arrayOpts[0]["choice"]!="No") Quote Link to comment Share on other sites More sharing options...
Zurev Posted January 13, 2011 Author Share Posted January 13, 2011 Presuming you don't want the value to be either zero or 'no': if ($arrayOpts[0]["choice"]!="0" && $arrayOpts[0]["choice"]!="No") I can't test it, but it seems that'll work. I honestly stared at those lines for a solid 1.5 hours today. :'( Quote Link to comment 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.