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

Method:hasCell

checks if a coordinate is valid

sample of a csv file "my_cool.csv"

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

load the csv file

$csv = new File_CSV_DataSource;
var_export($csv->load('my_cool.csv'));   // true if file is
// loaded

find out if a coordinate is valid

var_export($csv->hasCell(99, 3)); // false

check again for a know valid coordinate and grab that cell

var_export($csv->hasCell(1, 1));  // true
var_export($csv->getCell(1, 1));            // '8'
  1. Argument mixed $x the row to fetch
  2. Argument mixed $y the column to fetch
  • Visibility public
  • Returns void

Sign in to add a comment
Powered by Google Project Hosting