CaMykS  1.0-20231201
Functions
string.php.inc File Reference

Functions

 string_isValidIPv4 ($ip, $allow_mask=false)
 String specific methods. More...
 
 string_numberFormat ($string, $decimal=2, $country=null)
 
 string_html2Text ($string, $encoding=null)
 
 string_text2Html ($string, $encoding=null)
 
 string_text2Words ($string, $params=array())
 
 string_replaceEntityChars ($string, $params=array())
 
 string_getAccentuedChars ($params=array())
 
 string_parseSpecialChars ($string, $params=array())
 
 string_getShortenedSentence ($string='', $length=64)
 
 string_stripPHPTags ($value, $replace='')
 
 string_stripScriptTags ($value, $replace='')
 
 string_stripTags ($value, $replace='')
 
 string_isUTF8 ($string)
 
 string_isBase64 ($string)
 
 string_isHTML ($string)
 
 string_isURL ($string)
 
 string_startsWith ($haystack, $needle, $caseSensitive=false)
 
 string_endsWith ($haystack, $needle, $caseSensitive=false)
 
 string_getBaseURL ($url='')
 
 string_getSymbolicName ($text='', $params=array())
 
 string_encodeToHTML ($text, $flags=null, $encoding=null, $double_encode=null)
 
 string_formatIntlPhoneNumber ($number, $prefix='')
 
 string_toLower ($string='')
 
 string_toUpper ($string='')
 
 string_getSimilarBeginning ($s1, $s2)
 
 string_escape4Regex ($string='')
 
 string_parseNonLetterChars ($string)
 
 string_parsePHPTags ($value, $replace='')
 

Function Documentation

◆ string_isValidIPv4()

string_isValidIPv4 (   $ip,
  $allow_mask = false 
)

String specific methods.

Engine / Tool Library

Author
CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Version
1.0.9.1
Date
Creation: Oct 2007
Modification: Feb 2022
Note
This program is distributed as is - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Check if given ip (v4) is valid.
Parameters
string$ipthe ip address to test
boolean$allow_maskallows ip groups like 192.168.*.*
Returns
boolean

◆ string_numberFormat()

string_numberFormat (   $string,
  $decimal = 2,
  $country = null 
)

Format number string with current language country format.

Parameters
string$string
integer$decimal
string$country
Returns
string

◆ string_html2Text()

string_html2Text (   $string,
  $encoding = null 
)

Decode string from html to text.

Parameters
string$string
string$encoding
Returns
string

◆ string_text2Html()

string_text2Html (   $string,
  $encoding = null 
)

Encode string from text to html.

Parameters
string$string
string$encoding
Returns
string

◆ string_text2Words()

string_text2Words (   $string,
  $params = array() 
)

Return unaccentued words list from html.

Parameters
string$string
array$params- Available parameters are
string changecase - void / lower / upper
integer minlength
string contenttype - text / html
string accents - replace / keep
Returns
array

◆ string_replaceEntityChars()

string_replaceEntityChars (   $string,
  $params = array() 
)

Return replace entity char by unaccentued chars.

Parameters
string$string
array$params- Available parameters are
string/array pattern - containing patterns to complete built-in list
string/array replace - containing replacement values to complete built-in list
string lastreplace - all last entities are replaced by this value (empty string for no replacement)
Returns
string

◆ string_getAccentuedChars()

string_getAccentuedChars (   $params = array())

Return accentued chars list.

Parameters
array$params- Available parameters are
string listmode - array / string
string charmode - text / html
Returns
mixed

◆ string_parseSpecialChars()

string_parseSpecialChars (   $string,
  $params = array() 
)

Return parsed string, accentued chars are replaced by their unaccentued equivalent.

Parameters
string$string
array$params- Available parameters are
string/array pattern
string/array replace
Returns
string

◆ string_getShortenedSentence()

string_getShortenedSentence (   $string = '',
  $length = 64 
)

Return limited version of given sentence.

Parameters
string$string
integer$length
Returns
string

◆ string_stripPHPTags()

string_stripPHPTags (   $value,
  $replace = '' 
)

Remove PHP tags from value.

Parameters
string$value
string$replace
Returns
string

◆ string_stripScriptTags()

string_stripScriptTags (   $value,
  $replace = '' 
)

Remove Script tags from value.

Parameters
string$value
string$replace
Returns
string

◆ string_stripTags()

string_stripTags (   $value,
  $replace = '' 
)

Evolved strip_tags method, may replace tags by another string

Parameters
string$value
string$replace
Returns
string

◆ string_isUTF8()

string_isUTF8 (   $string)

Check if given string is UTF8.

Parameters
string$string
Returns
boolean

◆ string_isBase64()

string_isBase64 (   $string)

Check if given string is base64 encoded.

Parameters
string$string
Returns
boolean

◆ string_isHTML()

string_isHTML (   $string)

Check if given string is html.

Parameters
string$string
Returns
boolean

◆ string_isURL()

string_isURL (   $string)

Check if given string is an URL.

Parameters
string$string
Returns
boolean

◆ string_startsWith()

string_startsWith (   $haystack,
  $needle,
  $caseSensitive = false 
)

Check if given string starts with other string.

Parameters
string$haystack
mixed$needle
boolean$caseSensitive
Returns
boolean result

◆ string_endsWith()

string_endsWith (   $haystack,
  $needle,
  $caseSensitive = false 
)

Check if given string ends with other string.

Parameters
string$haystack
mixed$needle
boolean$caseSensitive
Returns
boolean result

◆ string_getBaseURL()

string_getBaseURL (   $url = '')

Return given string base url.

Parameters
string$url
Returns
string

◆ string_getSymbolicName()

string_getSymbolicName (   $text = '',
  $params = array() 
)

Return symbolic name (url compliant) from given string.

Parameters
string$text
array$params
Returns
string

◆ string_encodeToHTML()

string_encodeToHTML (   $text,
  $flags = null,
  $encoding = null,
  $double_encode = null 
)

Encode string to html.

Parameters
string$text
int$flags
string$encoding
boolean$double_encode
Returns
string

◆ string_formatIntlPhoneNumber()

string_formatIntlPhoneNumber (   $number,
  $prefix = '' 
)

Format given phone number.

Parameters
string$number
string$prefix
Returns
string

◆ string_toLower()

string_toLower (   $string = '')

Return string all lowercase, including accentuated characters.

Parameters
string$string
Returns
string

◆ string_toUpper()

string_toUpper (   $string = '')

Return string all uppercase, including accentuated characters.

Parameters
string$string
Returns
string

◆ string_getSimilarBeginning()

string_getSimilarBeginning (   $s1,
  $s2 
)

Return similar strings begining.

Parameters
string$s1
string$s2
Returns
string

◆ string_escape4Regex()

string_escape4Regex (   $string = '')

Return string escaped for regular expression.

Parameters
string$string
Returns
string

◆ string_parseNonLetterChars()

string_parseNonLetterChars (   $string)

Return string without non-letter chars.

See also
string_replaceEntityChars()
Parameters
string$string
Returns
string
Deprecated:
string_replaceEntityChars is now and often more accurate.

◆ string_parsePHPTags()

string_parsePHPTags (   $value,
  $replace = '' 
)

Remove PHP tags from value.

Parameters
string$value
string$replace
Returns
string
Deprecated:
Method renamed to string_stripPHPTags