Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationMain
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cApiPathresolveCacheHelper
  • cArray
  • cArticleCollector
  • cDirHandler
  • cFileHandler
  • cHTMLInputSelectElement
  • cIterator
  • cString
  • UI_Config_Table
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cArray

Array helper class.

Package: Core\Util
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Murat Purc <murat@purc.de>
Located at classes/class.array.php
Methods summary
public static array
# trim( array $arr, string $charlist = null )

Strip whitespace (or other characters) from the beginning and end of each item in array. Similar to trim() function.

Strip whitespace (or other characters) from the beginning and end of each item in array. Similar to trim() function.

Parameters

$arr
array
$arr
$charlist
string
$charlist

Returns

array
The trimmer array
public static mixed|boolean
# searchRecursive( array $arr, mixed $search, boolean $partial = false, boolean $strict = false )

Parameters

$arr
array
$arr The array to search
$search
mixed
$search The value to search in the array
$partial
boolean
$partial
$strict
boolean
$strict

Returns

mixed|boolean
The key/index of the array containing the searched value or false.

TODO:

Ask timo to document this. Note: If subarrays exists, this function currently returns the key of the array given by $arr, and not from the subarrays (todo: add flag to allow this)
public static array
# sortWithLocale( array $arr, string $locale )

Sorts an array by changing the locale temporary to passed value.

Sorts an array by changing the locale temporary to passed value.

Parameters

$arr
array
$arr The array to sort
$locale
string
$locale The locale to change before sorting

Returns

array
Sorted array
public static array
# csort( )

Very cool algorithm for sorting multi-dimensional arrays. Found at http://us2.php.net/manual/en/function.array-multisort.php Syntax:

$new_array = cArray::csort($array [, 'col1' [, SORT_FLAG [, SORT_FLAG]]]...);

Explanation: $array is the array you want to sort, 'col1' is the name of the column you want to sort, SORT_FLAGS are : SORT_ASC, SORT_DESC, SORT_REGULAR, SORT_NUMERIC, SORT_STRING you can repeat the 'col',FLAG,FLAG, as often you want, the highest prioritiy is given to the first - so the array is sorted by the last given column first, then the one before ... Example:

$array = cArray::csort($array,'town','age', SORT_DESC, 'name');

Very cool algorithm for sorting multi-dimensional arrays. Found at http://us2.php.net/manual/en/function.array-multisort.php Syntax:

$new_array = cArray::csort($array [, 'col1' [, SORT_FLAG [, SORT_FLAG]]]...);

Explanation: $array is the array you want to sort, 'col1' is the name of the column you want to sort, SORT_FLAGS are : SORT_ASC, SORT_DESC, SORT_REGULAR, SORT_NUMERIC, SORT_STRING you can repeat the 'col',FLAG,FLAG, as often you want, the highest prioritiy is given to the first - so the array is sorted by the last given column first, then the one before ... Example:

$array = cArray::csort($array,'town','age', SORT_DESC, 'name');

Returns

array
public static
# initializeKey( array & $aArray, string $sKey, mixed $mDefault = '' )

Ensures that the passed array has the key, sets it by using te value

Ensures that the passed array has the key, sets it by using te value

Parameters

$aArray
array
$aArray
$sKey
string
$sKey
$mDefault
mixed
$mDefault
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0