• Hello everyone!

    I would like to take information from a csv file in php code. This is my code:

    
    foreach ($imports->setColumns($imports->getTable() . '.*')->getBy(array('id !=' => ''))->convertRecords() as $imp){
    
    	$imp->getById($imp->id);
    
    	if ( ! $imp->isEmpty() and ! empty($imp->template)){
    
    	$options = array_merge($imp->options, $imp->template);
    
    	$this->__ver_4_transition_fix($options);
    	
    	$imp->set(array(
    		'options' => $options
    	))->update();
    
    	if ($imp->type == 'file'){
    	$imp->set(array(
    	'path' => $uploads['basedir'] . DIRECTORY_SEPARATOR . self::FILES_DIRECTORY . DIRECTORY_SEPARATOR . basename($imp->path)
    	))->update();
    	}
    }
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter raphael9747

    (@raphael9747)

    My problem in this code i don’t get any information of my csv file and i would like know why?

    $csv = array_map('str_getcsv', file('FL_insurance_sample.csv')); 
    print_r($csv);

    That’ll put all your CSV data into an array.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘I cannot get the information from my csv file’ is closed to new replies.