com-tecnick-tcexam-shared
[ class tree: com-tecnick-tcexam-shared ] [ index: com-tecnick-tcexam-shared ] [ all elements ]

Procedural File: tce_functions_general.php

Source Location: /shared/code/tce_functions_general.php



Page Details:

General functions.



Tags:

author:  Nicola Asuni
copyright:  Copyright © 2004-2008, Nicola Asuni - Tecnick.com S.r.l. - ITALY - www.tecnick.com - info@tecnick.com
link:  www.tecnick.com
since:  2001-09-08
license:  GNU General Public License








F_check_unique [line 120]

bool F_check_unique( string $table, string $where, [mixed $fieldname = FALSE], [mixed $fieldid = FALSE])

Check if specified fields are unique on table.



Tags:

return:  true if unique, false otherwise


Parameters

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
[ Top ]



F_compact_string [line 173]

converted F_compact_string( string $string)

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




Tags:

return:  string


Parameters

string   $string   input string to convert
[ Top ]



F_count_rows [line 58]

number F_count_rows( string $dbtable, [string $where = ''])

Count rows of the given table.



Tags:

return:  of rows


Parameters

string   $dbtable   database table name
string   $where   optional where SQL clause (including the WHERE keyword).
[ Top ]



F_empty_to_null [line 79]

string F_empty_to_null( string $str)

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



Tags:

return:  quoted if not empty, NULL otherwise


Parameters

string   $str   string to check.
[ Top ]



F_getBoolean [line 105]

boolean F_getBoolean( string $str)

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



Tags:

return:  value.


Parameters

string   $str   string to check.
[ Top ]



F_replace_angulars [line 183]

converted F_replace_angulars( string $str)

Replace angular parenthesis with html equivalents (html entities).



Tags:

return:  string


Parameters

string   $str   input string to convert
[ Top ]



F_substr_utf8 [line 195]

substring F_substr_utf8( string $str, [int $start = 0], int $length)

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



Parameters

string   $str   input string
int   $start   substring start index
int   $length   substring max lenght
[ Top ]



F_text_to_xml [line 212]

converted F_text_to_xml( string $str)

Escape some special characters (< > &).



Tags:

return:  string


Parameters

string   $str   input string to convert
[ Top ]



F_xml_to_text [line 222]

converted F_xml_to_text( string $str)

Unescape some special characters (< > &).



Tags:

return:  string


Parameters

string   $str   input string to convert
[ Top ]



F_zero_to_null [line 92]

string F_zero_to_null( string $num)

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



Tags:

return:  if != 0, NULL otherwise


Parameters

string   $num   string to check.
[ Top ]



showRequiredField [line 232]

html showRequiredField( [int $mode = 1])

Return a string containing an HTML acronym for required/not required fields.



Tags:

return:  string


Parameters

int   $mode   field mode: 1=not required; 2=required.
[ Top ]



unhtmlentities [line 149]

converted unhtmlentities( string $text_to_convert, [boolean $preserve_tagsign = FALSE])

Reverse function for htmlentities.



Tags:

return:  string


Parameters

string   $text_to_convert   input string to convert
boolean   $preserve_tagsign   if true preserve <> symbols, default=FALSE
[ Top ]



utrim [line 249]

string utrim( string $txt)

Strip whitespace (or other characters) from the beginning and end of an UTF-8 string and replace the \xA0 with normal space.



Tags:

return:  The trimmed string.


Parameters

string   $txt   The string that will be trimmed.
[ Top ]



Documentation generated on Thu, 05 Feb 2009 12:44:39 +0100 by phpDocumentor 1.4.1