PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Sazan Dauti   Simple PHP Array   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: This is an example of how to use the class
Class: Simple PHP Array
Manipulate the entries of an array
Author: By
Last change:
Date: 9 years ago
Size: 860 bytes


Class file image Download
//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();