Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8881873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:26:14+00:00 2026-06-14T20:26:14+00:00

Array ( [0] => Array ( [No.,Ticker,Company] => 1,A,Agilent Technologies Inc. ) [1] =>

  • 0
Array ( [0] => Array ( [No.,"Ticker","Company"] => 
                        1,"A","Agilent Technologies Inc." ) 
        [1] => Array ( [No.,"Ticker","Company" ] => 
                        2,"AA","Alcoa, Inc.") 
      )

This is the output when i type print_r($arrayOne);
What can I do so I can only get the Company column i.e. Agilent Technologies Inc, and Alocoa, Inc.

I tried echo $arrayOne[‘Company’] and $arrayOne[0][‘Company’] but it just outputted ‘Array’.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:26:15+00:00Added an answer on June 14, 2026 at 8:26 pm

    What you have is an outer array with two sub-arrays, each of which has only one value. Its key is the description of the 3 columns, and its value is the CSV value. If you have PHP 5.3, use str_getcsv() to parse it and return the third column

    // Loop over the outer array
    foreach ($arrayOne as  $subarr) {
      // Loop over the sub-arrays (though your sample only has one value each)
      // could also use array_pop()
      foreach ($subarr as $key => $csvstring) {
        // $csvstring holds the CSV value like  '1,"A","Agilent Technologies Inc."'
        // Parse it with str_getcsv()
        $cols = str_getcsv($csvstring);
        // Company name is the 3rd value, key [2]
        echo $cols[2] . "\n";
      }
    }
    

    For example with the input:

    $arrayOne = array(
      array('No.,"Ticker","Company"' => '1,"A","Agilent Technologies Inc."' ), 
      array('No.,"Ticker","Company"'  => '2,"AA","Alcoa, Inc."') 
    );
    // The above loop prints:
    Agilent Technologies Inc.
    Alcoa, Inc.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get the company name and its ticker symbol in different arrays.
I have a 2D Array. If I do print_r($equities[0]) , I get: Array (
I need to check array value, but when array is empty, I get this:
Array starts like this: Array ( [SMART Board] => Array ( [0] => sb1
Am trying to figure out how to do this.... I have an NSMutable array
$em = $this->getDoctrine()->getEntityManager(); $qb = $em->createQueryBuilder(); $tickets = $qb->select('COUNT(ticket.id)')->from('MyBundle:Ticket', 'ticket'); var_dump($tickets->getQuery()->getSingleScalarResult()); returns array(1) {
Ok I am confused by this, I have: a int variable a string array
I got this guy. He decode a string into a readble one. decodeURIComponent(Invalid Ticker
I have an XML: <?xml version=1.0 encoding=UTF-8?> <ticket> <comments type=array> <comment> <attachments type=array> <attachment>
I have a two-dimensional array which I get back as JSON from a call.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.