How to split given array and get value from array using php

Firoz P.J

Split below array and get values like

Category
Brand
Subcategory
Packaging
Packing

Array
 (
    [0] => Array
        (
            [0] => stdClass Object
                (
                    [col_ref_name] => Category
                )

        )

    [1] => Array
        (
            [0] => stdClass Object
                (
                    [col_ref_name] => Brand
                )

        )

    [2] => Array
        (
            [0] => stdClass Object
                (
                    [col_ref_name] => Subcategory
                )

        )

    [3] => Array
        (
            [0] => stdClass Object
                (
                    [col_ref_name] => Packaging
                )

        )

    [4] => Array
        (
            [0] => stdClass Object
                (
                    [col_ref_name] => Packing
                )

        )
)
Altaf Hussain

use a code like below :

foreach($yourArray as $array) 
{

     echo $array[0]-> col_ref_name . "<br>";
}

Your array has objects in the sub array and col_ref_name is the property of that objects, so i used a foreach loop to go through all elements of the array (which are objects) and then access the data in the col_ref_name.

I hope this will help.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Get the value from the given array

From Dev

How can get array key value from object using php

From Dev

How to get the value from nested array in php

From Dev

How to get integer value from array:php

From Dev

How to get the exact value from the array - php

From Dev

how to get maximum value from array php

From Dev

How to create a function to get sum of Colors from given array in php

From Dev

How to split text and get only array value by using shell script?

From Dev

php array how get in array value for using foreach

From Dev

how to get value array using key from array

From Dev

Get value from an array in php?

From Dev

PHP: Sort multidimensional array after given value (not from array)

From Dev

How to get the array from the given class Item?

From Dev

Get values from php array using a key value

From Dev

How to get even key value from array in PHP without using any loop

From Dev

how to get an array field value from a PHP file using jquery/Ajax in Symfony2?

From Dev

How to get the value from serialized array by using preg_match in php

From Dev

how to get an array field value from a PHP file using jquery/Ajax in Symfony2?

From Dev

How to get even key value from array in PHP without using any loop

From Dev

How to get one value from duplicates values in Multidimensional array using PHP?

From Dev

how to split a multidimensional array using key in php

From Dev

How to split a string into an array using a given regex expression

From Dev

How to split a string into an array using a given regex expression

From Dev

PHP Get Value from Array with Value of Key

From Dev

How to group the array by using array value, PHP

From Dev

How to group the array by using array value, PHP

From Dev

How get value from array

From Dev

How get value from array

From Dev

PHP how to populate array from array by value

Related Related

  1. 1

    Get the value from the given array

  2. 2

    How can get array key value from object using php

  3. 3

    How to get the value from nested array in php

  4. 4

    How to get integer value from array:php

  5. 5

    How to get the exact value from the array - php

  6. 6

    how to get maximum value from array php

  7. 7

    How to create a function to get sum of Colors from given array in php

  8. 8

    How to split text and get only array value by using shell script?

  9. 9

    php array how get in array value for using foreach

  10. 10

    how to get value array using key from array

  11. 11

    Get value from an array in php?

  12. 12

    PHP: Sort multidimensional array after given value (not from array)

  13. 13

    How to get the array from the given class Item?

  14. 14

    Get values from php array using a key value

  15. 15

    How to get even key value from array in PHP without using any loop

  16. 16

    how to get an array field value from a PHP file using jquery/Ajax in Symfony2?

  17. 17

    How to get the value from serialized array by using preg_match in php

  18. 18

    how to get an array field value from a PHP file using jquery/Ajax in Symfony2?

  19. 19

    How to get even key value from array in PHP without using any loop

  20. 20

    How to get one value from duplicates values in Multidimensional array using PHP?

  21. 21

    how to split a multidimensional array using key in php

  22. 22

    How to split a string into an array using a given regex expression

  23. 23

    How to split a string into an array using a given regex expression

  24. 24

    PHP Get Value from Array with Value of Key

  25. 25

    How to group the array by using array value, PHP

  26. 26

    How to group the array by using array value, PHP

  27. 27

    How get value from array

  28. 28

    How get value from array

  29. 29

    PHP how to populate array from array by value

HotTag

Archive