/shared/code/tce_functions_general.php

Description

General functions.

  • since: 2001-09-08
  • link: www.tecnick.com
  • copyright: Copyright © 2004-2006, Tecnick.com S.r.l. - Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info@tecnick.com
  • author: Nicola Asuni
Functions
F_check_unique (line 102)

Check if specified fields are unique on table.

  • return: true if unique, false otherwise
bool F_check_unique (string $table, string $where, [mixed $fieldname = FALSE], [mixed $fieldid = FALSE])
  • string $table: table name
  • string $where: SQL where clause
  • mixed $fieldname: name of table column to check
  • mixed $fieldid: ID of table row to check
F_compact_string (line 159)

Remove the following characters:

  • "\t" (ASCII 9 (0x09)), a tab.
  • "\n" (ASCII 10 (0x0A)), a new line (line feed)
  • "\r" (ASCII 13 (0x0D)), a carriage return
  • "\0" (ASCII 0 (0x00)), the NUL-byte
  • "\x0B" (ASCII 11 (0x0B)), a vertical tab

  • return: string
converted F_compact_string (string $string)
  • string $string: input string to convert
F_count_rows (line 38)

Count rows of the given table.

  • return: of rows
number F_count_rows (string $dbtable, [string $where = ""])
  • string $dbtable: database table name
  • string $where: optional where SQL clause (including the WHERE keyword).
F_empty_to_null (line 61)

Prepare field value for SQL query.
Returns the quoted string if not empty, NULL otherwise.

  • return: quoted if not empty, NULL otherwise
string F_empty_to_null (string $str)
  • string $str: string to check.
F_getBoolean (line 87)

Returns boolean value from string.
This function is needed to get the right boolean value from boolean field returned by PostgreSQL query.

  • return: value.
boolean F_getBoolean (string $str)
  • string $str: string to check.
F_replace_angulars (line 169)

Replace angular parenthesis with html equivalents (html entities).

  • return: string
converted F_replace_angulars (string $str)
  • string $str: input string to convert
F_substr_utf8 (line 181)

Return part of a string removing remaining non-ASCII characters.

substring F_substr_utf8 (string $str, [int $start = 0], int $length)
  • string $str: input string
  • int $start: substring start index
  • int $length: substring max lenght
F_text_to_xml (line 198)

Escape some special characters (< > &).

  • return: string
converted F_text_to_xml (string $str)
  • string $str: input string to convert
F_xml_to_text (line 208)

Unescape some special characters (< > &).

  • return: string
converted F_xml_to_text (string $str)
  • string $str: input string to convert
F_zero_to_null (line 74)

Prepare field value for SQL query.
Returns the num if different from zero, NULL otherwise.

  • return: if != 0, NULL otherwise
string F_zero_to_null (string $num)
  • string $num: string to check.
unhtmlentities (line 135)

Reverse function for htmlentities.

  • return: string
converted unhtmlentities (string $text_to_convert, [boolean $preserve_tagsign = FALSE])
  • string $text_to_convert: input string to convert
  • boolean $preserve_tagsign: if true preserve <> symbols, default=FALSE

Documentation generated on Fri, 24 Nov 2006 21:16:22 +0100 by phpDocumentor 1.3.0RC3