PHPDevShell 3.1.3-Stable
PHP OOP RAD Development Framework
/home/jason/NetBeansProjects/phpdev/includes/PHPDS_utils.inc.php File Reference

Functions

 PU_BuildGETArray (array $myGET, $includeInGet=null, $excludeFromGet=null)
 PU_BuildGETString (array $myGET, $glue= '&')
 PU_BuildGET ($includeInGet=null, $excludeFromGet=null, $glue= '&')
 PU_BuildAttrString (array $attributes=null, $glue= '')
 PU_buildParsedURL ($p)
 PU_BuildURL ($target=null, $includeInGet=null, $excludeFromGet=null, $glue= '&')
 PU_BuildHREF ($label, $includeInGet=null, $excludeFromGet=null, $target=null, array $attrs=null)
 PU_CleanString ($string, $clean_htlm=false)
 PU_MakeString ($string, $htmlize=false)
 PU_ArraySearch ($needle, $haystack)

Function Documentation

PU_ArraySearch ( needle,
haystack 
)

Search for array values inside array and returns key.

Parameters:
array$needle
array$haystack
Returns:
mixed

Wrapper for $core->__() method. Converts text to use gettext PO system. Does the same as $core->__();

Parameters:
string$say_whatThe string required to output or convert.
string$domainOverride textdomain that should be looked under for this text string.
Returns:
string Will return converted string or same string if not available.
Author:
Jason Schoeman

Specifically meant for core translation domain.

Parameters:
string$say_whatThe string required to output or convert.
Returns:
string

This function echos the returning text.

Parameters:
text$text

This function echos the returning text inside a domain.

Parameters:
text$text

PU_BuildAttrString ( array $  attributes = null,
glue = '' 
)

Build a xml-style attributes string based on an array

Version:
1.1
Date:
20091203
20110203 (v1.1) (greg) added the glue parameter
Parameters:
$attributesarray, the attribute array to compile
$gluestring, a piece of string to insert between the values
Returns:
string
PU_BuildGET ( includeInGet = null,
excludeFromGet = null,
glue = '&' 
)

Build GET part of a url

Parameters:
$includeInGet(optional) array of pairs: parameters to add as GET in the url
$excludeFromGet(optional) array of strings: parameters to remove from GET in the url
Returns:
string the whole parameter part of the url (including '?') ; maybe empty if there are no parameters
PU_BuildGETArray ( array $  myGET,
includeInGet = null,
excludeFromGet = null 
)

Build array from get url.

TODO: it's probably faster to use PHP build-in function (array_merge...)

Parameters:
array$myGET
array$includeInGet
array$excludeFromGet
Returns:
array
Date:
20110809 (v1.0.1) (greg) fixed a typo with $includeInGet
Author:
greg
PU_BuildGETString ( array $  myGET,
glue = '&' 
)

Creates a (string) url to be used with GET, including encoding

Parameters:
array$myGET
string$glue
Returns:
string
PU_BuildHREF ( label,
includeInGet = null,
excludeFromGet = null,
target = null,
array $  attrs = null 
)

Build a html link (A+HREF html tag) with label and url and GET parameters

Version:
1.0.1
Date:
20091203: added $attrs parameter
Parameters:
$labelstring: the text of the link
$includeInGet(optional) array of pairs: parameters to add as GET in the url
$excludeFromGet(optional) array of strings: parameters to remove from GET in the url
$target(optional) string: the target script url (current script if missing)
Returns:
string the complete html link
PU_buildParsedURL ( p)

Builds a parsed url.

Parameters:
array$p
Returns:
string
PU_BuildURL ( target = null,
includeInGet = null,
excludeFromGet = null,
glue = '&' 
)

Build a url with GET parameters

Parameters:
string | array$target(optional) string: the target script url (current script if missing)
array$includeInGet(optional) array of pairs: parameters to add as GET in the url
array$excludeFromGet(optional) array of strings: parameters to remove from GET in the url
Returns:
string the built url
Version:
1.1
Author:
greg
Date:
20100930 (v1.1) (greg) $target parameter can now be an array resulting from php's parse_url function
PU_CleanString ( string,
clean_htlm = false 
)

Clean a string from possibly harmful chars

These are removed: single and double quotes, backslashes, optionnaly html tags (everything between < and >)

A cleaned string should be safe to include in an html output

Parameters:
$stringthe string to clean
$clean_htlmif true, HTML tags are deleted too
Returns:
string
PU_MakeString ( string,
htmlize = false 
)

Convert a string to UTF8 (default) or to HTML

Parameters:
$stringthe string to convert
$htmlizeif true the string is converted to HTML, otherwise to UTF8
Returns:
string
 All Data Structures Files Functions Variables Enumerations