Download the PHP package econic/csvreader without Composer

On this page you can find all versions of the php package econic/csvreader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package csvreader

CsvReader

CsvReader is a unit-tested PHP composer package with a utility class that reads your csv data and converts it into an associative two-dimensional array. Everything is configurable and many options and even modifiers can do the work for you...

License

CsvReader is released under the MIT license

Usage

Usage couldn't be simpler: just set the source, configure your options & get the result.

minimum configuration

result

With this you can easily iterate over your result:

Or even more convenient, when you set a key for your values (see below to learn how):

Characters

CSVreader has plenty of options to offer. You don't have to use any of them and you can use all of them at once if you want. Just as you like. Just use the respective setters/adders on the CSVreader object.

All setters/adders return the CSVreader object for easy chaining.

source

The source given as string. It contains the CSV data you want to get parsed.

Type: String
Default: ''

delimiter

The delimiter in the csv data. Want a semicolon here? No problem...

Type: String
Default: ','

newline

The newline character in the csv data. You don't break lines? Ok then... how about a dash?

Type: String
Default: "\n"

enclosure

The enclosure character in the csv data. Useful when your values contain the delimiter or the newline character. Just wrap your whole value with the enclosure caracter.

Type: String
Default: '"'

escape

The escape character in the csv data. Ok now you have " as enclosure character but your value contains a " ... Just prefix it with the escape character!

Type: String
Default: '\'

Options

You can configure even more with CSVreader, like the keys, modifiers, a global trim, ...

trim

If the values should be trimmed after parsing. Turned on by default. Will be executed before the modifiers.

Type: Boolean
Default: true

keys

Change the keys if you want to access the values via their respective attribute names.

Type1: Integer, Type2: String

Add multiple keys at once like so

Type: Array

Reset the keys whenever necessary

modifiers

Let's say the first value in every line of your csv is a title. It saved like "-v-a-l-u-e-" but your result should be like "VALUE". Just add a modifier at your chosen key and let the reader to its work. First parameter is the position of your value (0 based) or, if you chose another key for the value, your key.

Type1: Integer/String, Type2: Callable

Done. Every value will have its dashes removed and converted to uppercase. Of course you can do extremely intense stuff here. And you can stack the modifiers. As many as you want. They will be executed in the order you added them.

If you want to remove the modifiers after you added them, you can reset the modifiers of one key or all modifiers. Use

to remove all modifiers or

to remove just the modifiers registered for the title value.


All versions of csvreader with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package econic/csvreader contains the following files

Loading the files please wait ....