Solutions Open Source

Référence de la classe t3lib_div

Liste de tous les membres

Fonctions membres publiques

 trimExplode ($delim, $string, $onlyNonEmptyValues=0)
 dirname ($path)
 revExplode ($delim, $string, $count=0)
 getIndpEnv ($getEnvName)
 _GP ($var)
 _GET ($var=NULL)
 _POST ($var=NULL)
 _GETset ($inputGet, $key='')
 GPvar ($var, $strip=0)
 GParrayMerged ($var)
 gif_compress ($theFile, $type)
 png_to_gif_by_imagemagick ($theFile)
 read_png_gif ($theFile, $output_png=0)
 fixed_lgd ($string, $origChars, $preStr='...')
 fixed_lgd_pre ($string, $chars)
 fixed_lgd_cs ($string, $chars)
 breakTextForEmail ($str, $implChar="\n", $charWidth=76)
 breakLinesForEmail ($str, $implChar="\n", $charWidth=76)
 cmpIP ($baseIP, $list)
 cmpIPv4 ($baseIP, $list)
 cmpIPv6 ($baseIP, $list)
 IPv6Hex2Bin ($hex)
 normalizeIPv6 ($address)
 validIPv6 ($ip)
 cmpFQDN ($baseIP, $list)
 inList ($list, $item)
 rmFromList ($element, $list)
 expandList ($list)
 intInRange ($theInt, $min, $max=2000000000, $zeroValue=0)
 intval_positive ($theInt)
 int_from_ver ($verNumberStr)
 compat_version ($verNumberStr)
 md5int ($str)
 shortMD5 ($input, $len=10)
 uniqueList ($in_list, $secondParameter=NULL)
 split_fileref ($fileref)
 dirname ($path)
 modifyHTMLColor ($color, $R, $G, $B)
 modifyHTMLColorAll ($color, $all)
 rm_endcomma ($string)
 danish_strtoupper ($string)
 convUmlauts ($str)
 testInt ($var)
 isFirstPartOfStr ($str, $partStr)
 formatSize ($sizeInBytes, $labels='')
 convertMicrotime ($microtime)
 splitCalc ($string, $operators)
 calcPriority ($string)
 calcParenthesis ($string)
 htmlspecialchars_decode ($value)
 deHSCentities ($str)
 slashJS ($string, $extended=0, $char="'")
 rawUrlEncodeJS ($str)
 rawUrlEncodeFP ($str)
 validEmail ($email)
 formatForTextarea ($content)
 inArray ($in_array, $item)
 intExplode ($delim, $string)
 revExplode ($delim, $string, $count=0)
 trimExplode ($delim, $string, $onlyNonEmptyValues=0)
 uniqueArray ($valueArray)
 removeArrayEntryByValue ($array, $cmpValue)
 implodeArrayForUrl ($name, $theArray, $str='', $skipBlank=0, $rawurlencodeParamName=0)
 explodeUrl2Array ($string, $multidim=FALSE)
 compileSelectedGetVarsFromArray ($varList, $getArray, $GPvarAlt=1)
 addSlashesOnArray (&$theArray)
 stripSlashesOnArray (&$theArray)
 slashArray ($arr, $cmd)
 array_merge_recursive_overrule ($arr0, $arr1, $notAddKeys=0, $includeEmtpyValues=true)
 array_merge ($arr1, $arr2)
 csvValues ($row, $delim=',', $quote='"')
 removeDotsFromTS ($ts)
 get_tag_attributes ($tag)
 split_tag_attributes ($tag)
 implodeAttributes ($arr, $xhtmlSafe=FALSE, $dontOmitBlankAttribs=FALSE)
 implodeParams ($arr, $xhtmlSafe=FALSE, $dontOmitBlankAttribs=FALSE)
 wrapJS ($string, $linebreak=TRUE)
 xml2tree ($string, $depth=999)
 array2xml_cs ($array, $docTag='phparray', $options=array(), $charset='')
 array2xml ($array, $NSprefix='', $level=0, $docTag='phparray', $spaceInd=0, $options=array(), $stackData=array())
 xml2array ($string, $NSprefix='', $reportDocTag=FALSE)
 xmlRecompileFromStructValArray ($vals)
 xmlGetHeaderAttribs ($xmlData)
 getURL ($url, $includeHeader=0, $requestHeaders=false)
 writeFile ($file, $content)
 fixPermissions ($file)
 writeFileToTypo3tempDir ($filepath, $content)
 mkdir ($theNewFolder)
 mkdir_deep ($destination, $deepDir)
 get_dirs ($path)
 getFilesInDir ($path, $extensionList='', $prependPath=0, $order='', $excludePattern='')
 getAllFilesAndFoldersInPath ($fileArr, $path, $extList='', $regDirs=0, $recursivityLevels=99, $excludePattern='')
 removePrefixPathFromList ($fileArr, $prefixToRemove)
 fixWindowsFilePath ($theFile)
 resolveBackPath ($pathStr)
 locationHeaderUrl ($path)
 debug_ordvalue ($string, $characters=100)
 view_array ($array_in)
 print_array ($array_in)
 debug ($var="", $brOrHeader=0)
 debug_trail ()
 debugRows ($rows, $header='')
 getThisUrl ()
 linkThisScript ($getParams=array())
 linkThisUrl ($url, $getParams=array())
 getIndpEnv ($getEnvName)
 milliseconds ()
 clientInfo ($useragent='')
 getHostname ($requestHost=TRUE)
 getFileAbsFileName ($filename, $onlyRelative=1, $relToTYPO3_mainDir=0)
 validPathStr ($theFile)
 isAbsPath ($path)
 isAllowedAbsPath ($path)
 verifyFilenameAgainstDenyPattern ($filename)
 upload_copy_move ($source, $destination)
 upload_to_tempfile ($uploadedFileName)
 unlink_tempfile ($uploadedTempFileName)
 tempnam ($filePrefix)
 stdAuthCode ($uid_or_record, $fields='', $codeLength=8)
 cHashParams ($addQueryParams)
 hideIfNotTranslated ($l18n_cfg_fieldValue)
 readLLfile ($fileRef, $langKey)
 readLLXMLfile ($fileRef, $langKey)
 llXmlAutoFileName ($fileRef, $language)
 loadTCA ($table)
 resolveSheetDefInDS ($dataStructArray, $sheet='sDEF')
 resolveAllSheetsInDS ($dataStructArray)
 callUserFunction ($funcName, &$params, &$ref, $checkPrefix='user_', $silent=0)
getUserObj ($classRef, $checkPrefix='user_', $silent=0)
makeInstance ($className)
 makeInstanceClassName ($className)
makeInstanceService ($serviceType, $serviceSubType='', $excludeServiceKeys=array())
 requireOnce ($requireFile)
 plainMailEncoded ($email, $subject, $message, $headers='', $encoding='quoted-printable', $charset='', $dontEncodeHeader=false)
 quoted_printable ($string, $maxlen=76)
 encodeHeader ($line, $enc='quoted-printable', $charset='ISO-8859-1')
 substUrlsInPlainText ($message, $urlmode='76', $index_script_url='')
 makeRedirectUrl ($inUrl, $l=0, $index_script_url='')
 freetypeDpiComp ($font_size)
 initSysLog ()
 sysLog ($msg, $extKey, $severity=0)
 devLog ($msg, $extKey, $severity=0, $dataVar=FALSE)
 arrayToLogString ($arr, $valueList=array(), $valueLength=20)
 imageMagickCommand ($command, $parameters, $path='')
 unQuoteFilenames ($parameters, $unQuote=FALSE)
 quoteJSvalue ($value, $inScriptTags=false)


Documentation des fonctions membres

t3lib_div::trimExplode ( delim,
string,
onlyNonEmptyValues = 0 
)

t3lib_div::dirname ( path  ) 

t3lib_div::revExplode ( delim,
string,
count = 0 
)

t3lib_div::getIndpEnv ( getEnvName  ) 

Abstraction method which returns System Environment Variables regardless of server OS, CGI/MODULE version etc. Basically this is SERVER variables for most of them. This should be used instead of getEnv() and HTTP_SERVER_VARS/ENV_VARS to get reliable values for all situations.

Usage: 226

Paramètres:
string Name of the "environment variable"/"server variable" you wish to use. Valid values are SCRIPT_NAME, SCRIPT_FILENAME, REQUEST_URI, PATH_INFO, REMOTE_ADDR, REMOTE_HOST, HTTP_REFERER, HTTP_HOST, HTTP_USER_AGENT, HTTP_ACCEPT_LANGUAGE, QUERY_STRING, TYPO3_DOCUMENT_ROOT, TYPO3_HOST_ONLY, TYPO3_HOST_ONLY, TYPO3_REQUEST_HOST, TYPO3_REQUEST_URL, TYPO3_REQUEST_SCRIPT, TYPO3_REQUEST_DIR, TYPO3_SITE_URL, _ARRAY
Renvoie:
string Value based on the input key, independent of server/os environment.

t3lib_div::_GP ( var  ) 

Returns the 'GLOBAL' value of incoming data from POST or GET, with priority to POST (that is equalent to 'GP' order) Strips slashes from all output, both strings and arrays. This function substitutes t3lib_div::GPvar() To enhancement security in your scripts, please consider using t3lib_div::_GET or t3lib_div::_POST if you already know by which method your data is arriving to the scripts! Usage: 537

Paramètres:
string GET/POST var to return
Renvoie:
mixed POST var named $var and if not set, the GET var of the same name.
Voir également:
GPvar()

t3lib_div::_GET ( var = NULL  ) 

Returns the global GET array (or value from) normalized to contain un-escaped values. ALWAYS use this API function to acquire the GET variables! Usage: 27

Paramètres:
string Optional pointer to value in GET array (basically name of GET var)
Renvoie:
mixed If $var is set it returns the value of $_GET[$var]. If $var is NULL (default), returns $_GET itself. In any case *slashes are stipped from the output!*
Voir également:
_POST(), _GP(), _GETset()

t3lib_div::_POST ( var = NULL  ) 

Returns the global POST array (or value from) normalized to contain un-escaped values. ALWAYS use this API function to acquire the POST variables! Usage: 41

Paramètres:
string Optional pointer to value in POST array (basically name of POST var)
Renvoie:
mixed If $var is set it returns the value of $_POST[$var]. If $var is NULL (default), returns $_POST itself. In any case *slashes are stipped from the output!*
Voir également:
_GET(), _GP()

t3lib_div::_GETset ( inputGet,
key = '' 
)

Writes input value to $_GET Usage: 2

Paramètres:
array Array to write to $_GET. Values should NOT be escaped at input time (but will be escaped before writing according to TYPO3 standards).
string Alternative key; If set, this will not set the WHOLE GET array, but only the key in it specified by this value!
Renvoie:
void

t3lib_div::GPvar ( var,
strip = 0 
)

GET/POST variable Returns the 'GLOBAL' value of incoming data from POST or GET, with priority to POST (that is equalent to 'GP' order) Strips slashes of string-outputs, but not arrays UNLESS $strip is set. If $strip is set all output will have escaped characters unescaped. Usage: 2

Paramètres:
string GET/POST var to return
boolean If set, values are stripped of return values that are *arrays!* - string/integer values returned are always strip-slashed()
Renvoie:
mixed POST var named $var and if not set, the GET var of the same name.
Obsolète:
Use t3lib_div::_GP instead (ALWAYS delivers a value with un-escaped values!)
Voir également:
_GP()

t3lib_div::GParrayMerged ( var  ) 

Returns the GET/POST global arrays merged with POST taking precedence. Usage: 1

Paramètres:
string Key (variable name) from GET or POST vars
Renvoie:
array Returns the GET vars merged recursively onto the POST vars.
Obsolète:

t3lib_div::gif_compress ( theFile,
type 
)

Compressing a GIF file if not already LZW compressed This function is a workaround for the fact that ImageMagick and/or GD does not compress GIF-files to their minimun size (that is RLE or no compression used)

The function takes a file-reference, $theFile, and saves it again through GD or ImageMagick in order to compress the file GIF: If $type is not set, the compression is done with ImageMagick (provided that $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'] is pointing to the path of a lzw-enabled version of 'convert') else with GD (should be RLE-enabled!) If $type is set to either 'IM' or 'GD' the compression is done with ImageMagick and GD respectively PNG: No changes.

$theFile is expected to be a valid GIF-file! The function returns a code for the operation. Usage: 9

Paramètres:
string Filepath
string See description of function
Renvoie:
string Returns "GD" if GD was used, otherwise "IM" if ImageMagick was used. If nothing done at all, it returns empty string.

t3lib_div::png_to_gif_by_imagemagick ( theFile  ) 

Converts a png file to gif This converts a png file to gif IF the FLAG $GLOBALS['TYPO3_CONF_VARS']['FE']['png_to_gif'] is set true. Usage: 5

Paramètres:
string $theFile the filename with path
Renvoie:
string new filename

t3lib_div::read_png_gif ( theFile,
output_png = 0 
)

Returns filename of the png/gif version of the input file (which can be png or gif). If input file type does not match the wanted output type a conversion is made and temp-filename returned. Usage: 2

Paramètres:
string Filepath of image file
boolean If set, then input file is converted to PNG, otherwise to GIF
Renvoie:
string If the new image file exists, it's filepath is returned

t3lib_div::fixed_lgd ( string,
origChars,
preStr = '...' 
)

Truncate string Returns a new string of max. $chars length. If the string is longer, it will be truncated and appended with '...'. Usage: 39

Paramètres:
string string to truncate
integer must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end.
string String to append to the output if it is truncated, default is '...'
Renvoie:
string new string
Obsolète:
Works ONLY for single-byte charsets! USE t3lib_div::fixed_lgd_cs() instead
Voir également:
fixed_lgd_pre()

t3lib_div::fixed_lgd_pre ( string,
chars 
)

Truncate string Returns a new string of max. $chars length. If the string is longer, it will be truncated and prepended with '...'. This works like fixed_lgd, but is truncated in the start of the string instead of the end Usage: 6

Paramètres:
string string to truncate
integer must be an integer of at least 4
Renvoie:
string new string
Obsolète:
Use either fixed_lgd() or fixed_lgd_cs() (with negative input value for $chars)
Voir également:
fixed_lgd()

t3lib_div::fixed_lgd_cs ( string,
chars 
)

Truncates a string with appended/prepended "..." and takes backend character set into consideration Use only from backend! Usage: 75

Paramètres:
string string to truncate
integer must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end.
Renvoie:
string New string
Voir également:
fixed_lgd()

t3lib_div::breakTextForEmail ( str,
implChar = "\n",
charWidth = 76 
)

Breaks up the text for emails Usage: 1

Paramètres:
string The string to break up
string The string to implode the broken lines with (default/typically
)
integer The line length
Obsolète:
Use PHP function wordwrap()
Renvoie:
string

t3lib_div::breakLinesForEmail ( str,
implChar = "\n",
charWidth = 76 
)

Breaks up a single line of text for emails Usage: 5

Paramètres:
string The string to break up
string The string to implode the broken lines with (default/typically
)
integer The line length
Renvoie:
string
Voir également:
breakTextForEmail()

t3lib_div::cmpIP ( baseIP,
list 
)

Match IP number with list of numbers with wildcard Dispatcher method for switching into specialised IPv4 and IPv6 methods. Usage: 10

Paramètres:
string $baseIP is the current remote IP address for instance, typ. REMOTE_ADDR
string $list is a comma-list of IP-addresses to match with. *-wildcard allowed instead of number, plus leaving out parts in the IP number is accepted as wildcard (eg. 192.168.*.* equals 192.168). If list is "*" no check is done and the function returns TRUE immediately.
Renvoie:
boolean True if an IP-mask from $list matches $baseIP

t3lib_div::cmpIPv4 ( baseIP,
list 
)

Match IPv4 number with list of numbers with wildcard

Paramètres:
string $baseIP is the current remote IP address for instance, typ. REMOTE_ADDR
string $list is a comma-list of IP-addresses to match with. *-wildcard allowed instead of number, plus leaving out parts in the IP number is accepted as wildcard (eg. 192.168.*.* equals 192.168)
Renvoie:
boolean True if an IP-mask from $list matches $baseIP

t3lib_div::cmpIPv6 ( baseIP,
list 
)

Match IPv6 address with a list of IPv6 prefixes

Paramètres:
string $baseIP is the current remote IP address for instance
string $list is a comma-list of IPv6 prefixes, could also contain IPv4 addresses
Renvoie:
boolean True if an baseIP matches any prefix

t3lib_div::IPv6Hex2Bin ( hex  ) 

[Describe function...]

Paramètres:
[type] $hex: ...
Renvoie:
[type] ...

t3lib_div::normalizeIPv6 ( address  ) 

Normalize an IPv6 address to full length

Paramètres:
string Given IPv6 address
Renvoie:
string Normalized address

t3lib_div::validIPv6 ( ip  ) 

Validate a given IP address to the IPv6 address format.

Example for possible format: 43FBBB3F:A0A0:0 | ::1

Paramètres:
string IP address to be tested
Renvoie:
boolean True if $ip is of IPv6 format.

t3lib_div::cmpFQDN ( baseIP,
list 
)

Match fully qualified domain name with list of strings with wildcard

Paramètres:
string The current remote IP address for instance, typ. REMOTE_ADDR
string A comma-list of domain names to match with. *-wildcard allowed but cannot be part of a string, so it must match the full host name (eg. myhost.*.com => correct, myhost.*domain.com => wrong)
Renvoie:
boolean True if a domain name mask from $list matches $baseIP

t3lib_div::inList ( list,
item 
)

Check for item in list Check if an item exists in a comma-separated list of items. Usage: 163

Paramètres:
string comma-separated list of items (string)
string item to check for
Renvoie:
boolean true if $item is in $list

t3lib_div::rmFromList ( element,
list 
)

Removes an item from a comma-separated list of items. Usage: 1

Paramètres:
string element to remove
string comma-separated list of items (string)
Renvoie:
string new comma-separated list of items

t3lib_div::expandList ( list  ) 

Expand a comma-separated list of integers with ranges (eg 1,3-5,7 becomes 1,3,4,5,7). Ranges are limited to 1000 values per range.

Paramètres:
string comma-separated list of integers with ranges (string)
Renvoie:
string new comma-separated list of items
Auteur:
Martin Kutschker <martin.kutschker@activesolution.at>

t3lib_div::intInRange ( theInt,
min,
max = 2000000000,
zeroValue = 0 
)

Forces the integer $theInt into the boundaries of $min and $max. If the $theInt is 'false' then the $zeroValue is applied. Usage: 224

Paramètres:
integer Input value
integer Lower limit
integer Higher limit
integer Default value if input is false.
Renvoie:
integer The input value forced into the boundaries of $min and $max

t3lib_div::intval_positive ( theInt  ) 

Returns the $integer if greater than zero, otherwise returns zero. Usage: 1

Paramètres:
integer Integer string to process
Renvoie:
integer

t3lib_div::int_from_ver ( verNumberStr  ) 

Returns an integer from a three part version number, eg '4.12.3' -> 4012003 Usage: 2

Paramètres:
string Version number on format x.x.x
Renvoie:
integer Integer version of version number (where each part can count to 999)

t3lib_div::compat_version ( verNumberStr  ) 

Returns true if the current TYPO3 version (or compatibility version) is compatible to the input version Notice that this function compares branches, not versions (4.0.1 would be > 4.0.0 although they use the same compat_version)

Paramètres:
string Minimum branch number required (format x.y / e.g. "4.0" NOT "4.0.0"!)
Renvoie:
boolean Returns true if this setup is compatible with the provided version number
À faire:
Still needs a function to convert versions to branches

t3lib_div::md5int ( str  ) 

Makes a positive integer hash out of the first 7 chars from the md5 hash of the input Usage: 5

Paramètres:
string String to md5-hash
Renvoie:
integer Returns 28bit integer-hash

t3lib_div::shortMD5 ( input,
len = 10 
)

Returns the first 10 positions of the MD5-hash (changed from 6 to 10 recently)

Usage: 37

Paramètres:
string Input string to be md5-hashed
integer The string-length of the output
Renvoie:
string Substring of the resulting md5-hash, being $len chars long (from beginning)

t3lib_div::uniqueList ( in_list,
secondParameter = NULL 
)

Takes comma-separated lists and arrays and removes all duplicates If a value in the list is trim(empty), the value is ignored. Usage: 16

Paramètres:
string Accept multiple parameters wich can be comma-separated lists of values and arrays.
mixed $secondParameter: Dummy field, which if set will show a warning!
Renvoie:
string Returns the list without any duplicates of values, space around values are trimmed

t3lib_div::split_fileref ( fileref  ) 

Splits a reference to a file in 5 parts Usage: 43

Paramètres:
string Filename/filepath to be analysed
Renvoie:
array Contains keys [path], [file], [filebody], [fileext], [realFileext]

t3lib_div::dirname ( path  ) 

Returns the directory part of a path without trailing slash If there is no dir-part, then an empty string is returned. Behaviour:

'/dir1/dir2/script.php' => '/dir1/dir2' '/dir1/' => '/dir1' 'dir1/script.php' => 'dir1' 'd/script.php' => 'd' '/script.php' => '' '' => '' Usage: 5

Paramètres:
string Directory name / path
Renvoie:
string Processed input value. See function description.

t3lib_div::modifyHTMLColor ( color,
R,
G,
B 
)

Modifies a HTML Hex color by adding/subtracting $R,$G and $B integers Usage: 11

Paramètres:
string A hexadecimal color code, xxxxxx
integer Offset value 0-255
integer Offset value 0-255
integer Offset value 0-255
Renvoie:
string A hexadecimal color code, xxxxxx, modified according to input vars
Voir également:
modifyHTMLColorAll()

t3lib_div::modifyHTMLColorAll ( color,
all 
)

Modifies a HTML Hex color by adding/subtracting $all integer from all R/G/B channels Usage: 6

Paramètres:
string A hexadecimal color code, xxxxxx
integer Offset value 0-255 for all three channels.
Renvoie:
string A hexadecimal color code, xxxxxx, modified according to input vars
Voir également:
modifyHTMLColor()

t3lib_div::rm_endcomma ( string  ) 

Removes comma (if present) in the end of string Usage: 2

Paramètres:
string String from which the comma in the end (if any) will be removed.
Renvoie:
string

t3lib_div::danish_strtoupper ( string  ) 

strtoupper which converts danish (and other characters) characters as well Usage: 0

Paramètres:
string String to process
Renvoie:
string
Obsolète:
Use t3lib_cs::conv_case() instead or for HTML output, wrap your content in ...)

t3lib_div::convUmlauts ( str  ) 

Change umlaut characters to plain ASCII with normally two character target Only known characters will be converted, so don't expect a result for any character.

ä => ae, Ö => Oe

Paramètres:
string String to convert.
Obsolète:
Works only for western europe single-byte charsets! Use t3lib_cs::specCharsToASCII() instead!
Renvoie:
string

t3lib_div::testInt ( var  ) 

Tests if the input is an integer. Usage: 77

Paramètres:
mixed Any input variable to test.
Renvoie:
boolean Returns true if string is an integer

t3lib_div::isFirstPartOfStr ( str,
partStr 
)

Returns true if the first part of $str matches the string $partStr Usage: 59

Paramètres:
string Full string to check
string Reference string which must be found as the "first part" of the full string
Renvoie:
boolean True if $partStr was found to be equal to the first part of $str

t3lib_div::formatSize ( sizeInBytes,
labels = '' 
)

Formats the input integer $sizeInBytes as bytes/kilobytes/megabytes (-/K/M) Usage: 53

Paramètres:
integer Number of bytes to format.
string Labels for bytes, kilo, mega and giga separated by vertical bar (|) and possibly encapsulated in "". Eg: " | K| M| G" (which is the default value)
Renvoie:
string Formatted representation of the byte number, for output.

t3lib_div::convertMicrotime ( microtime  ) 

Returns microtime input to milliseconds Usage: 2

Paramètres:
string Microtime
Renvoie:
integer Microtime input string converted to an integer (milliseconds)

t3lib_div::splitCalc ( string,
operators 
)

This splits a string by the chars in $operators (typical /+-*) and returns an array with them in Usage: 2

Paramètres:
string Input string, eg "123 + 456 / 789 - 4"
string Operators to split by, typically "/+-*"
Renvoie:
array Array with operators and operands separated.
Voir également:
tslib_cObj::calc(), tslib_gifBuilder::calcOffset()

t3lib_div::calcPriority ( string  ) 

Calculates the input by +,-,*,/,%,^ with priority to + and - Usage: 1

Paramètres:
string Input string, eg "123 + 456 / 789 - 4"
Renvoie:
integer Calculated value. Or error string.
Voir également:
calcParenthesis()

t3lib_div::calcParenthesis ( string  ) 

Calculates the input with parenthesis levels Usage: 2

Paramètres:
string Input string, eg "(123 + 456) / 789 - 4"
Renvoie:
integer Calculated value. Or error string.
Voir également:
calcPriority(), tslib_cObj::stdWrap()

t3lib_div::htmlspecialchars_decode ( value  ) 

Inverse version of htmlspecialchars() Usage: 4

Paramètres:
string Value where >, <, " and & should be converted to regular chars.
Renvoie:
string Converted result.

t3lib_div::deHSCentities ( str  ) 

Re-converts HTML entities if they have been converted by htmlspecialchars() Usage: 10

Paramètres:
string String which contains eg. "&amp;amp;" which should stay "&amp;". Or "&amp;#1234;" to "&#1234;". Or "&amp;#x1b;" to "&#x1b;"
Renvoie:
string Converted result.

t3lib_div::slashJS ( string,
extended = 0,
char = "'" 
)

This function is used to escape any ' -characters when transferring text to JavaScript! Usage: 3

Paramètres:
string String to escape
boolean If set, also backslashes are escaped.
string The character to escape, default is ' (single-quote)
Renvoie:
string Processed input string

t3lib_div::rawUrlEncodeJS ( str  ) 

Version of rawurlencode() where all spaces (20) are re-converted to space-characters. Usefull when passing text to JavaScript where you simply url-encode it to get around problems with syntax-errors, linebreaks etc. Usage: 4

Paramètres:
string String to raw-url-encode with spaces preserved
Renvoie:
string Rawurlencoded result of input string, but with all 20 (space chars) converted to real spaces.

t3lib_div::rawUrlEncodeFP ( str  ) 

rawurlencode which preserves "/" chars Usefull when filepaths should keep the "/" chars, but have all other special chars encoded. Usage: 5

Paramètres:
string Input string
Renvoie:
string Output string

t3lib_div::validEmail ( email  ) 

Checking syntax of input email address Usage: 5

Paramètres:
string Input string to evaluate
Renvoie:
boolean Returns true if the $email address (input string) is valid; Has a "@", domain name with at least one period and only allowed a-z characters.

t3lib_div::formatForTextarea ( content  ) 

Formats a string for output between <textarea>-tags All content outputted in a textarea form should be passed through this function Not only is the content htmlspecialchar'ed on output but there is also a single newline added in the top. The newline is necessary because browsers will ignore the first newline after <textarea> if that is the first character. Therefore better set it! Usage: 23

Paramètres:
string Input string to be formatted.
Renvoie:
string Formatted for <textarea>-tags

t3lib_div::inArray ( in_array,
item 
)

Check if an item exists in an array Please note that the order of parameters is reverse compared to the php4-function in_array()!!! Usage: 3

Paramètres:
array one-dimensional array of items
string item to check for
Renvoie:
boolean true if $item is in the one-dimensional array $in_array

t3lib_div::intExplode ( delim,
string 
)

Explodes a $string delimited by $delim and passes each item in the array through intval(). Corresponds to explode(), but with conversion to integers for all values. Usage: 76

Paramètres:
string Delimiter string to explode with
string The string to explode
Renvoie:
array Exploded values, all converted to integers

t3lib_div::revExplode ( delim,
string,
count = 0 
)

Reverse explode which explodes the string counting from behind. Thus t3lib_div::revExplode(':','my:words:here',2) will return array('my:words','here') Usage: 8

Paramètres:
string Delimiter string to explode with
string The string to explode
integer Number of array entries
Renvoie:
array Exploded values

t3lib_div::trimExplode ( delim,
string,
onlyNonEmptyValues = 0 
)

Explodes a string and trims all values for whitespace in the ends. If $onlyNonEmptyValues is set, then all blank ('') values are removed. Usage: 256

Paramètres:
string Delimiter string to explode with
string The string to explode
boolean If set, all empty values (='') will NOT be set in output
Renvoie:
array Exploded values

t3lib_div::uniqueArray ( valueArray  ) 

Remove duplicate values from an array Usage: 0

Paramètres:
array Array of values to make unique
Renvoie:
array
Obsolète:
Use the PHP function array_unique instead

t3lib_div::removeArrayEntryByValue ( array,
cmpValue 
)

Removes the value $cmpValue from the $array if found there. Returns the modified array Usage: 3

Paramètres:
array Array containing the values
string Value to search for and if found remove array entry where found.
Renvoie:
array Output array with entries removed if search string is found

t3lib_div::implodeArrayForUrl ( name,
theArray,
str = '',
skipBlank = 0,
rawurlencodeParamName = 0 
)

Implodes a multidim-array into GET-parameters (eg. &param[key][key2]=value2&param[key][key3]=value3) Usage: 24

Paramètres:
string Name prefix for entries. Set to blank if you wish none.
array The (multidim) array to implode
string (keep blank)
boolean If set, parameters which were blank strings would be removed.
boolean If set, the param name itself (for example "param[key][key2]") would be rawurlencoded as well.
Renvoie:
string Imploded result, fx. &param[key][key2]=value2&param[key][key3]=value3
Voir également:
explodeUrl2Array()

t3lib_div::explodeUrl2Array ( string,
multidim = FALSE 
)

Explodes a string with GETvars (eg. "&id=1&type=2&ext[mykey]=3") into an array

Paramètres:
string GETvars string
boolean If set, the string will be parsed into a multidimensional array if square brackets are used in variable names (using PHP function parse_str())
Renvoie:
array Array of values. All values AND keys are rawurldecod