0

There's probably a simple reason that I'm overlooking, but my second if statement, the one with the condition of sizeof($duplicate) > 0, is not functioning properly. The block of html is still being displayed, despite the fact that I have verified that the size of $duplicate is in fact 0, and no list is being displayed under the paragraph tags. Am I missing something?

<html>
<head>
</head>
<body>
    <?php echo (sizeof($duplicate)); ?>
    <?php if(sizeof($not_exist > 0)) : ?>
        <p>The following companies were not updated because their Company Name did not exist in database: </p>
        <ul>
            <?php foreach($not_exist as $entry) {
                echo "<li>Company Name: " . $entry . "</li>";
            }
            ?>
        </ul>
    <?php endif; ?>
    <?php if(sizeof($duplicate > 0)) : ?>
        <p>The following companies had more than 1 entry under the same Company Name in database:</p>
        <ul>
            <?php foreach($duplicate as $entry) {
                echo "<li>Company Name: " . $entry . "</li>";
            }
            ?>
        </ul>
    <?php endif; ?>
    <?php if(sizeof($failed > 0)) : ?>
        <p>The following companies were not updated because the new Display Name already exists in QuickBooks:</p>
        <ul>
            <?php foreach($failed as $entry) {
                echo "<li>Company Name: " . $entry . "</li>";
            }
            ?>
        </ul>
    <?php endif; ?>
</body>

Thanks!

1
  • 1
    You've written if(sizeof($duplicate > 0)) :. Should be if(sizeof($duplicate) > 0) :. Commented Jun 11, 2015 at 15:44

1 Answer 1

3
<?php if(sizeof($duplicate )>0) : ?>
Sign up to request clarification or add additional context in comments.

1 Comment

I knew it was something dumb. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.