File/structure/functions.php

Description

Some useful functions

  • author: Andreas Plank <andreas.plank@web.de>
  • version: 2009-02-24 21:24:33
  • todo: minor issue: document further detailed
  • license: Noncommercial-Share
Functions
FilesRead (line 124)

Read files in a directory

  • return: array of files
array FilesRead (string $strDir, [string $strFileToSearch = ''], [boolean $isSimple = false])
  • string $strDir: searched directory (relative)
  • string $strFileToSearch: which file to search
  • boolean $isSimple: if true then with $LastModified
lb2string (line 110)

replace linebreaks to

void lb2string (string $string, [string $replace = '&lt;br&gt;'])
  • string $string
  • string $replace: what to replace
putToArray (line 164)

Put things into an array

Helper function used in regular expression search to creates an array usable for instance by $_SESSION['references']

array|content putToArray (string $content, array &$arrayToPut, [boolean $print = false])
  • string $content
  • boolean $print: do print?
  • array &$arrayToPut: put in which array
replaceHTMLcode (line 94)

Replace difficult code characters

For instance with javascript overlib it collapse to have in abstracts or notes a single quote

void replaceHTMLcode ( $string)
  • $string
tabprint (line 32)

Print a pretty table to save

Used for references. Usage eg.:

  1. call_user_func('tabprint'$SQL-Result-ArrayMySQL-Table-Definition$addStructure)
It tries to change fields according to MySQL table fields

HTML tabprint (array $arrTabFieldData, array $arrMysqlTableStructure, [array $addStructure = array()], [array $addElements = array()])
  • array $arrTabFieldData: values from MySQL data table
  • array $arrMysqlTableStructure: MySQL table structure
  • array $addStructure: additional HTML elements as array. Array key = data base field e.g.
    1. array(
    2.      'name_author' => ' disabled class="disabled" '
    3.  );
  • array $addElements: additional input elements as array. Array key = data base field e.g.
    1. array(
    2.      'id' => ' <input ...> '
    3.  );
user_sortwords (line 194)

Sort comma lists by patternSplit or arrays to strings

string|false user_sortwords (mixed $words, [bool $isUnique = TRUE], [string $patternSplit = &quot; *, +&quot;], [string $patternJoin = &quot;, &quot;])
  • mixed $words: string with commas or array
  • bool $isUnique: should sorting be unique?
  • string $patternSplit: the pattern to split the string
  • string $patternJoin: the pattern to join the string again

Documentation generated on Sun, 19 Jul 2009 14:48:42 +0800 by phpDocumentor 1.4.2