HEX
Server: LiteSpeed
System: Linux d8 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: wbwebdes (3015)
PHP: 8.1.31
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/wbwebdes/domains/survey.wb-webdesign.com/private_html/vendor/tiamo/spss/examples/write.php
<?php

use SPSS\Sav\Variable;

require __DIR__ . '/../vendor/autoload.php';

$file = __DIR__ . '/data.sav';

$writer = new \SPSS\Sav\Writer(array(
        'header' => array(
            'prodName' => '@(#) IBM SPSS STATISTICS 64-bit Macintosh 23.0.0.0',
            'creationDate' => '05 Oct 18',
            'creationTime' => '01:36:53',
            'weightIndex' => 0,
            // 'casesCount' => 3,
            // 'compression' => 1,
            // 'bias' => 100,
            // 'fileLabel' => '',
        ),
        // 'info' => [
        //     'machineInteger' => [
        //         'machineCode' => 720,
        //         'version' => [23, 0, 0],
        //     ],
        //     'machineFloatingPoint' => [
        //         'sysmis' => -1.7976931348623157e+308,
        //         'highest' => 1.7976931348623157e+308,
        //         'lowest' => -1.7976931348623155e+308,
        //     ],
        // ],
        'variables' => array(
            array(
                'name' => 'aaa',
                'format' => Variable::FORMAT_TYPE_F,
                'width' => 4,
                'decimals' => 2,
                'label' => 'test',
                'values' => array(
                    222 => 'foo',
                    '13.22' => 'bar',
                ),
                // 'missing' => [],
                'columns' => 16,
                'alignment' => Variable::ALIGN_RIGHT,
                'measure' => Variable::MEASURE_SCALE,
                'attributes' => array(
                    '$@Role' => Variable::ROLE_PARTITION,
                ),
                'data' => array(1, 1, 1),
            ),
            array(
                'name' => 'bbbb_bbbbbb12',
                'format' => Variable::FORMAT_TYPE_A,
                'width' => 28,
                // 'decimals' => 0,
                'label' => 'test',
                'values' => array(
                    'm' => 'male',
                    'f' => 'female',
                ),
                // 'missing' => [],
                'columns' => 8,
                'alignment' => Variable::ALIGN_LEFT,
                'measure' => Variable::MEASURE_NOMINAL,
                'attributes' => array(
                    '$@Role' => Variable::ROLE_SPLIT,
                ),
                'data' => array('foo', 'bar', 'baz'),
            ),
            array(
                'name' => 'BBBB_BBBBBB13',
                'format' => Variable::FORMAT_TYPE_COMMA,
                'width' => 8,
                'decimals' => 2,
                // 'label' => 'test',
                // 'values' => [
                //     1 => 'test'
                // ],
                // 'missing' => [],
                'columns' => 8,
                'alignment' => Variable::ALIGN_RIGHT,
                'measure' => Variable::MEASURE_NOMINAL,
                'attributes' => array(
                    '$@Role' => Variable::ROLE_INPUT,
                ),
                'data' => array(1, 1, 1),
            ),
        ),
    )
);

$writer->save($file);