mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
parse readability
This commit is contained in:
@@ -206,20 +206,37 @@ class parseCSV {
|
||||
* @param input CSV file or string
|
||||
* @return nothing
|
||||
*/
|
||||
function parse ($input = null, $offset = null, $limit = null, $conditions = null) {
|
||||
if ( $input === null ) $input = $this->file;
|
||||
if ( !empty($input) ) {
|
||||
if ( $offset !== null ) $this->offset = $offset;
|
||||
if ( $limit !== null ) $this->limit = $limit;
|
||||
if ( count($conditions) > 0 ) $this->conditions = $conditions;
|
||||
if ( is_readable($input) ) {
|
||||
public function parse ($input = null, $offset = null, $limit = null, $conditions = null) {
|
||||
if ($input===null) {
|
||||
$input = $this->file;
|
||||
}
|
||||
|
||||
if (!empty($input)) {
|
||||
if ($offset!==null) {
|
||||
$this->offset = $offset;
|
||||
}
|
||||
|
||||
if ($limit!==null) {
|
||||
$this->limit = $limit;
|
||||
}
|
||||
|
||||
if (count($conditions)>0) {
|
||||
$this->conditions = $conditions;
|
||||
}
|
||||
|
||||
if (is_readable($input)) {
|
||||
$this->data = $this->parse_file($input);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$this->file_data = &$input;
|
||||
$this->data = $this->parse_string();
|
||||
}
|
||||
if ( $this->data === false ) return false;
|
||||
|
||||
if ($this->data===false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user