PHP Classes

PHP File Text One: Import data from files in CSV or JSON formats

Recommend this page to a friend!
  Info   View files Example   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 82 This week: 1All time: 10,052 This week: 560Up
Version License PHP version Categories
filetextone 1.0.0GNU Lesser Genera...5PHP 5, Files and Folders
Description 

Author

This package can import data from files in CSV or JSON formats.

It can take the path of a file with data stored in either CVS or JSON format and processes the data to make it available as arrays.

The class can detect the types of data stored in the rows of CSV files and convert them to the respective PHP data type.

Picture of Jorge Castro
  Performance   Level  
Name: Jorge Castro <contact>
Classes: 30 packages by
Country: Chile Chile
Age: 48
All time rank: 12763 in Chile Chile
Week rank: 106 Up1 in Chile Chile Up
Innovation award
Innovation award
Nominee: 14x

Winner: 2x

Example

<?php

use eftec\FileTextOne;

error_reporting(E_STRICT);
include
'../vendor/autoload.php';

$filetextoone=new FileTextOne('csv','grades.csv');
$filetextoone->setCsvStyle(',','"',true,"\n");
echo
"<pre>";
$filetextoone->toAll();
//var_dump($filetextoone->toAll());
var_dump($filetextoone->columnTypes);
echo
"</pre>";

$obj=[];
$obj["Last name"]= "Alfalfa";
$obj["First name"]= "Aloysius";
$obj["SSN"]="123-45-6789";
$obj["Test1"]=40;
$obj["Test2"]=90;
$obj["Test3"]=100;
$obj["Test4"]=83;
$obj["Final"]=49;
$obj["Grade"]= "D-";

$filetextoone->insert($obj);


Details

FileTextOne

pending


  Files folder image Files  
File Role Description
Files folder imageexamples (7 files)
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Data Read me

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file dolar.csv Data Auxiliary data
  Accessible without login Plain text file dolar.json Data Auxiliary data
  Accessible without login Plain text file grades.csv Data Auxiliary data
  Accessible without login Plain text file new.json Data Auxiliary data
  Accessible without login Plain text file test.php Example Example script
  Accessible without login Plain text file testjson.php Example Example script
  Accessible without login Plain text file testjsoninsert.php Example Example script

  Files folder image Files  /  src  
File Role Description
  Plain text file FileTextOne.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:82
This week:1
All time:10,052
This week:560Up