PHPackages                             heydon/uarray - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. heydon/uarray

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

heydon/uarray
=============

Allow manipulation of PICK Dynamic Arrays in PHP for use with RockSoftware's U2 products

v1.0.1(12y ago)22962MITPHPPHP &gt;=5.3.0

Since May 21Pushed 12y ago1 watchersCompare

[ Source](https://github.com/gheydon/uarray)[ Packagist](https://packagist.org/packages/heydon/uarray)[ Docs](https://github.com/gheydon/uarray)[ RSS](/packages/heydon-uarray/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (8)Used By (2)

uArray [![Build Status](https://camo.githubusercontent.com/223f74f883b3d5615d5d86b53383bb69bc128471fffdfa77af226120c5db9822/68747470733a2f2f7472617669732d63692e6f72672f67686579646f6e2f7561727261792e706e67)](https://travis-ci.org/gheydon/uarray)
====================================================================================================================================================================================================================================================

[](#uarray-)

Allow manipulation of PICK Dynamic Arrays in PHP

PICK Dynamic Arrays are how the PICK operating system stores arrays in the database. The data itself is a single text string with delimiters inserted with the string to break the string up into different fields.

- Attribute Mark *AM* (\\xfe) ^
- Value Make *VM* (\\xfd) \]
- Sub Value Mark *SVM* (\\xdc) \\

These marks allow the system to break up the string into the fields which can be used by the system to indicate the fields and recurring values.

Installation
------------

[](#installation)

Installation via [composer](http://getcomposer.com) is the only method supported at this stage. Edit your composer.json to add the following.

```
{
    "require": {
        // ...
        "heydon/uarray": "1.0.x"
    }
}
```

\##Example Variable

```
1]2]3]4]5^Value 1]Value 2]Value 3]Value 4]Value 5

```

Example Code
------------

[](#example-code)

```
$array = new uArray("1\xfd2\xfd3\xfd4\xfd5\xfeValue 1\xfdValue 2\xfdValue 3\xfdValue 4\xfdValue 5");

$a = $array[1] // VAR = 1]2]3]4]5
$a = $array[1][2] // VAR = 2
```

### Setting a value

[](#setting-a-value)

In PICK BASIC you would do the following to insert a value

```
A = 'example'
```

in PHP the following will be done.

```
$a = new uArray();
$a[1][2] = 'example'
```

the result of this would be the same as the PICK equivilent.

```
]example

```

### unsetting a value

[](#unsetting-a-value)

PICK/u2 doesn't really have a delete value, which will delete the value and not having "sliding delimiters". so in PICK/u2 BASIC you would do something like

```
A = 1:VM:2:VM:3
A = ''
PRINT A ;* would result in 1]]3
```

In PHP this can be done 2 ways.

```
$a = new uArray("1\xfd2\xfd3");
unset($a[2]); // or
$a[2] = '';
```

### Inserting values

[](#inserting-values)

To insert values into an array which in PICK/u2 you would do the following.

```
A = 100:VM:200:VM:300:VM:400:VM:500
INS 350 BEFORE A
```

and in PHP the following will be done.

```
$array = new uArray("100\xfd200\xfd300\xfd400\xfd500");

$array->ins(350, 4);
```

### Deleting values

[](#deleting-values)

When deleting a value in PICK the following is done.

```
A = 100:VM:200:VM:300:VM:400:VM:500
DEL A
```

to do the equivilent in PHP

```
$array = new uArray("100\xfd200\xfd300\xfd400\xfd500");

$array->del(3);
```

### Associated Arrays

[](#associated-arrays)

Dynamic arrays in PICK/u2 and PHP are fundermentally different. The following is an example of how a basic invoice would be reprsented in PICK/u2

```
01: 10]20]30
02: Item 1]Item 2]Item 3
03: 100]200]300

```

Where in this example the line 1 is the item number, 2 is the item name, and 3 is the cost. But in PHP this same array would be represented this in the following way.

```
$order = array(
  10 => array(
    'title' => 'Item 1',
    'price' => 1.00,
  ),
  20 => array(
    'title' => 'Item 2',
    'price' => 2.00,
  ),
  30 => array(
    'title' => 'Item 3',
    'price' => 3.00,
  ),
);
```

Keeping the attributes in alignment is not very easy or very natural in PHP, so the ::fetchAssoc() has been created to allow easier manipulation of the PICK/u2 associated array.

```
$v = new uArray('10\xfd20\xfd30\xfeItem 1\xfdItem 2\xfdItem 3\xfe100\xfd200\xfd300');
$assoc = $v->fetchAssoc(array(2,3), 1); // tell fetchAssoc() to user attribute 2 and 3 as the values and attribute 1 as the key

echo "Item: $assoc[20][2]\n"; // to access the values

$assoc[] = array(2 => 'Item 4', 3 => 400); // Which will add an new associated value and keep all the values inline.
```

Any object which implements the uAssocArraySource can implement the fetchAssoc() method.

### Checking for changes.

[](#checking-for-changes)

Since the uArray was primarily built to work with RedBack, there needed to be the ability to capture changes so they can be sent to the backend server. The Taint flag was created and can be reset when needed to allow to detect changes during a specific period.

```
$value = new uArray('example');
$value->resetTaint(); // Resets the taint flag.
$value->isTainted(); // checks to see if the valiable has changed.
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Recently: every ~23 days

Total

7

Last Release

4683d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/70891?v=4)[Gordon Heydon](/maintainers/gheydon)[@gheydon](https://github.com/gheydon)

---

Top Contributors

[![gheydon](https://avatars.githubusercontent.com/u/70891?v=4)](https://github.com/gheydon "gheydon (59 commits)")

---

Tags

RocketSoftwareu2

### Embed Badge

![Health badge](/badges/heydon-uarray/health.svg)

```
[![Health](https://phpackages.com/badges/heydon-uarray/health.svg)](https://phpackages.com/packages/heydon-uarray)
```

###  Alternatives

[overtrue/laravel-favorite

User favorite features for Laravel Application.

448315.4k1](/packages/overtrue-laravel-favorite)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k9.6k1](/packages/vinkius-labs-laravel-page-speed)[burnbright/silverstripe-externalurlfield

Provides SilverStripe with a DBField and FormField for handling external URLs.

109.6k1](/packages/burnbright-silverstripe-externalurlfield)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
