PHP Classes

Simple PHP Array: Manipulate the entries of an array

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 47%Total: 387 All time: 6,676 This week: 361Up
Version License PHP version Categories
simple-php-array 1.0GNU General Publi...3.0PHP 5, Data types


This class can manipulate the entries of an array.

It wraps around an array and provides several types of functions to manipulate the array entries. Currently it can:

- Append the values of another given array to the array
- Add a value to the array at the end or at a given position
- Set an array entry at a given position to a given value
- Change all array entries with a given value to another value
- Get the positions of all array entries with a given value
- Remove array entries at a given position or with a given value
- Etc.

Picture of Sazan Dauti
Name: Sazan Dauti <contact>
Classes: 3 packages by
Country: United States United States
Age: 28
All time rank: 2810389 in United States United States
Week rank: 258 Up27 in United States United States Up


//Require class file
require "simplearray.class.php";

$s = new SimpleArray;

//Load an existing array
$exArray = array("The", "is", "a", "quick", "example", "of", "loading", "an", "array");

//Manually add values

Add array value to certain key
$s->addI(key, value);

Set array values by key
$s->set(key, value);

Change certain array values

Remove array value by key

Remove certain array values

Get size of the array

Get array value from key

Get an array with all keys that match a certain value

Clear an array

//Get the final array
$finalArray = $s->arr();



  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example This is an example of how to use the class
Accessible without login Plain text file LICENSE Lic. The License
Plain text file simplearray.class.php Class The main class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,676
This week:361Up
 User Ratings  
 All time