Loading ...
Sorry, an error occurred while loading the content.

Array Question

Expand Messages
  • Raul Berina
    [0] = Array ( [0] = Array ( [id] = 4321 [name] = domainstats [title] = Domain Stats [icon] = /icons/widget/1234.png [description] = This is an
    Message 1 of 4 , Jun 3, 2008
    • 0 Attachment
      [0] => Array (


      [0] => Array
      (
      [id] => 4321
      [name] => domainstats
      [title] => Domain Stats
      [icon] => /icons/widget/1234.png
      [description] => This is an example of Garbages code by (RAUL BERINA)
      [width] => 2
      )

      [1] => Array
      (
      [id] => 41222
      [name] => trafficstat
      [title] => Traffic Stats
      [icon] => /icons/widget/1234.png
      [description] => This is an example of Garbages code by (RAUL BERINA)
      [width] => 2
      )


      )

      I have an array result like above..

      how can I get the result like only from above array?:

      [0] => Array
      (
      [id] => 4321
      [name] => domainstats
      [title] => Domain Stats
      [icon] => /icons/widget/1234.png
      [description] => This is an example of Garbages code by (RAUL BERINA)
      [width] => 2
      )

      [1] => Array
      (
      [id] => 41222
      [name] => trafficstat
      [title] => Traffic Stats
      [icon] => /icons/widget/1234.png
      [description] => This is an example of Garbages code by (RAUL BERINA)
      [width] => 2
      )









      [Non-text portions of this message have been removed]
    • Daniel Israel
      If you presume your array is $foo and this is the output from print_r, you could just say: $bar = $foo[0]; and $bar would be what you re looking for... ... -D.
      Message 2 of 4 , Jun 3, 2008
      • 0 Attachment
        If you presume your array is $foo and this is the output from print_r,
        you could just say:

        $bar = $foo[0];

        and $bar would be what you're looking for...

        On Jun 3, 2008, at 5:56 PM, Raul Berina wrote:

        >
        > [0] => Array (
        >
        >
        > [0] => Array
        > (
        > [id] => 4321
        > [name] => domainstats
        > [title] => Domain Stats
        > [icon] => /icons/widget/1234.png
        > [description] => This is an example of Garbages
        > code by (RAUL BERINA)
        > [width] => 2
        > )
        >
        > [1] => Array
        > (
        > [id] => 41222
        > [name] => trafficstat
        > [title] => Traffic Stats
        > [icon] => /icons/widget/1234.png
        > [description] => This is an example of Garbages
        > code by (RAUL BERINA)
        > [width] => 2
        > )
        >
        >
        > )
        >
        > I have an array result like above..
        >
        > how can I get the result like only from above array?:
        >
        > [0] => Array
        > (
        > [id] => 4321
        > [name] => domainstats
        > [title] => Domain Stats
        > [icon] => /icons/widget/1234.png
        > [description] => This is an example of Garbages
        > code by (RAUL BERINA)
        > [width] => 2
        > )
        >
        > [1] => Array
        > (
        > [id] => 41222
        > [name] => trafficstat
        > [title] => Traffic Stats
        > [icon] => /icons/widget/1234.png
        > [description] => This is an example of Garbages
        > code by (RAUL BERINA)
        > [width] => 2
        > )
        >
        >
        >
        >
        >
        >
        >
        >
        >
        > [Non-text portions of this message have been removed]
        >
        >
        > ------------------------------------
        >
        > Are you looking for a PHP job? Join the PHP Professionals directory
        > Now!
        > http://www.phpclasses.org/professionals/Yahoo! Groups Links
        >
        >
        >

        -D. Israel
        dan@...
        http://www.customcodebydan.com
        AIM: JudoDanIzz



        [Non-text portions of this message have been removed]
      • Raul Berina
        is from for loop for ($i=0;$i
        Message 3 of 4 , Jun 3, 2008
        • 0 Attachment
          is from for loop

          for ($i=0;$i<sizeof($widgets);$i++){
          $widget = $widgets[$i];
          $w_ctr = 0;
          $w_list = array();
          for ($j=0;$j<sizeof($arr_fields);$j++) {
          $fields = $arr_fields[$j];
          if (isset($widget[$fields])){
          $w_list[$fields] = $widget[$fields];
          }
          }
          $widget_lists[] = $w_list;
          $w_ctr++;
          }

          $print_r($widget_lists);


          Daniel Israel <dan@...> wrote:
          If you presume your array is $foo and this is the output from print_r,
          you could just say:

          $bar = $foo[0];

          and $bar would be what you're looking for...

          On Jun 3, 2008, at 5:56 PM, Raul Berina wrote:

          >
          > [0] => Array (
          >
          >
          > [0] => Array
          > (
          > [id] => 4321
          > [name] => domainstats
          > [title] => Domain Stats
          > [icon] => /icons/widget/1234.png
          > [description] => This is an example of Garbages
          > code by (RAUL BERINA)
          > [width] => 2
          > )
          >
          > [1] => Array
          > (
          > [id] => 41222
          > [name] => trafficstat
          > [title] => Traffic Stats
          > [icon] => /icons/widget/1234.png
          > [description] => This is an example of Garbages
          > code by (RAUL BERINA)
          > [width] => 2
          > )
          >
          >
          > )
          >
          > I have an array result like above..
          >
          > how can I get the result like only from above array?:
          >
          > [0] => Array
          > (
          > [id] => 4321
          > [name] => domainstats
          > [title] => Domain Stats
          > [icon] => /icons/widget/1234.png
          > [description] => This is an example of Garbages
          > code by (RAUL BERINA)
          > [width] => 2
          > )
          >
          > [1] => Array
          > (
          > [id] => 41222
          > [name] => trafficstat
          > [title] => Traffic Stats
          > [icon] => /icons/widget/1234.png
          > [description] => This is an example of Garbages
          > code by (RAUL BERINA)
          > [width] => 2
          > )
          >
          >
          >
          >
          >
          >
          >
          >
          >
          > [Non-text portions of this message have been removed]
          >
          >
          > ------------------------------------
          >
          > Are you looking for a PHP job? Join the PHP Professionals directory
          > Now!
          > http://www.phpclasses.org/professionals/Yahoo! Groups Links
          >
          >
          >

          -D. Israel
          dan@...
          http://www.customcodebydan.com
          AIM: JudoDanIzz

          [Non-text portions of this message have been removed]











          [Non-text portions of this message have been removed]
        • mobby j philip
          Hi, You can use this function to dispaly the result array print_r(firstarray[0]); ... From: Raul Berina <raul_berina_fq@yahoo.com> Subject: [php-objects]
          Message 4 of 4 , Jun 3, 2008
          • 0 Attachment
            Hi,



            You can use this function to dispaly the result array

            print_r(firstarray[0]);





            --- On Wed, 4/6/08, Raul Berina <raul_berina_fq@...> wrote:
            From: Raul Berina <raul_berina_fq@...>
            Subject: [php-objects] Array Question
            To: "PHP Object" <php-objects@yahoogroups.com>
            Date: Wednesday, 4 June, 2008, 6:26 AM













            [0] => Array (



            [0] => Array

            (

            [id] => 4321

            [name] => domainstats

            [title] => Domain Stats

            [icon] => /icons/widget/ 1234.png

            [description] => This is an example of Garbages code by (RAUL BERINA)

            [width] => 2

            )



            [1] => Array

            (

            [id] => 41222

            [name] => trafficstat

            [title] => Traffic Stats

            [icon] => /icons/widget/ 1234.png

            [description] => This is an example of Garbages code by (RAUL BERINA)

            [width] => 2

            )



            )



            I have an array result like above..



            how can I get the result like only from above array?:



            [0] => Array

            (

            [id] => 4321

            [name] => domainstats

            [title] => Domain Stats

            [icon] => /icons/widget/ 1234.png

            [description] => This is an example of Garbages code by (RAUL BERINA)

            [width] => 2

            )



            [1] => Array

            (

            [id] => 41222

            [name] => trafficstat

            [title] => Traffic Stats

            [icon] => /icons/widget/ 1234.png

            [description] => This is an example of Garbages code by (RAUL BERINA)

            [width] => 2

            )



            [Non-text portions of this message have been removed]



























            From Chandigarh to Chennai - find friends all over India. Go to http://in.promos.yahoo.com/groups/citygroups/

            [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.