My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
getColumn  
Updated Feb 4, 2010 by kazu....@gmail.com

Method:getColumn

column fetcher

gets all the data for a specific column identified by $name

Note $name is the same as the items returned by getHeaders()

sample of a csv file "my_cool.csv"

name,age,skill
john,13,knows magic
tanaka,8,makes sushi
jose,5,dances salsa

php implementation

$csv = new File_CSV_DataSource;
$csv->load('my_cool.csv');
var_export($csv->getColumn('name'));

the above example outputs something like

array (
0 => 'john',
1 => 'tanaka',
2 => 'jose',
)
  1. Argument string $name the name of the column to fetch
  • Visibility public
  • Returns array filled with values of a column
  • Also see getHeaders(), fillColumn(), appendColumn(), getCell(), getRows(),

getRow(), hasColumn()


Sign in to add a comment
Powered by Google Project Hosting