8000 GitHub - kofrimpong/spss: A PHP library for reading and writing SPSS data files.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kofrimpong/spss

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPSS

A PHP library for reading and writing SPSS data files.

Requirements

  • PHP 5.3.0 and up.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist tiamo/spss "*"

or add

"tiamo/spss": "*"

to the require section of your composer.json file.

Usage

Reader example:

$reader = \SPSS\Reader::fromFile('path/to/file.sav');

or

$reader = \SPSS\Reader::fromString(file_get_contents('path/to/file.sav'));

Writer example:

$writer = new \SPSS\Writer([
    'header' => [
            'prodName'     => '@(#) SPSS DATA FILE test',
            'layoutCode'   => 2,
            'compression'  => 1,
            'weightIndex'  => 0,
            'bias'         => 100,
            'creationDate' => '13 Feb 89',
            'creationTime' => '13:13:13',
    ],
    'variables' => [
        [
                'name'     => 'VAR1',
                'width'    => 0,
                'decimals' => 0
                'format'   => 5,
                'columns'  => 50,
                'align'    => 1,
                'measure'  => 1,
                'data'     => [
                    1, 2, 3
                ],
        ],
        ...
    ]
]);

License

Licensed under the MIT license.

About

A PHP library for reading and writing SPSS data files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%
0