Welcome Guest, Not a member yet? Register   Sign In
PHP stdClass object: getting data throught foreah loop
#5

[eluser]developer10[/eluser]
[quote author="adityamenon" date="1309386230"]Cheers! By the way, I found another way on StackOverflow today :

Code:
//put your object in place of $object and you might it in array form in $array...
$array = json_decode(json_encode($object), true);

...you might want to check that out too Smile[/quote]

Actually, I made this complicated all by my own fault.
This simple code does what i need:

Code:
<?php
    $rSetArtists = $rSetArtists[1];

    foreach ($rSetArtists as $key => $value):
        echo $value->_ARTIST_NAME . '<br />';
    endforeach;

    echo $renderPaginationLinks;
    ?&gt;

At the start, reducing of that multidimensional array is done so the remainder is treated as any other arrayed resultset.

Thanks anyway, that JSON line of code might be useful for me in the future!


Messages In This Thread
PHP stdClass object: getting data throught foreah loop - by El Forum - 06-26-2011, 11:49 AM
PHP stdClass object: getting data throught foreah loop - by El Forum - 06-26-2011, 12:58 PM
PHP stdClass object: getting data throught foreah loop - by El Forum - 06-29-2011, 11:15 AM
PHP stdClass object: getting data throught foreah loop - by El Forum - 06-29-2011, 11:23 AM
PHP stdClass object: getting data throught foreah loop - by El Forum - 06-29-2011, 12:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB