1
    <?php 
    $result = $sth1->fetchAll(PDO::FETCH_ASSOC);
    foreach($result as $row)
    { 

    echo "<div class='listing'>";
        print $row['uUName'] . '</strong><br />' .
        '<strong>' . $row['listTitle'] . '</strong><br />' .
        $arr = explode(':', $row['diff']);
        echo "{$arr[0]} hours, {$arr[1]} minutes ago";
    echo "</div>";
    }
    unset($sth1);   
    ?>      

Outputting

Array01 hours, 48 minutes ago
Array04 hours, 01 minutes ago

How do I get RID of : Array01 Array04 from the beginning and just be left with:

01 hours, 48 minutes ago
04 hours, 01 minutes ago

1 Answer 1

2
<?php 
$result = $sth1->fetchAll(PDO::FETCH_ASSOC);
foreach($result as $row)
{ 

echo "<div class='listing'>";
    print $row['uUName'] . '</strong><br />' .
    '<strong>' . $row['listTitle'] . '</strong><br />';
    $arr = explode(':', $row['diff']);
    echo "{$arr[0]} hours, {$arr[1]} minutes ago";
echo "</div>";
}
unset($sth1);   
?>

Notice line 8, where I've removed your '. and replaced it with '; in the end.

Sign up to request clarification or add additional context in comments.

Comments

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.