Overview

Classes

  • Api1
  • Array1
  • ArrayObject1
  • Auth1
  • AuthModel1
  • Chat1
  • Class1
  • Color1
  • Console1
  • Controller1
  • Converter1
  • Cookie1
  • Date1
  • DateManager1
  • Db1
  • DbPref1
  • EasyBook
  • EasyCountry
  • EasyGenerator
  • EasyProduct
  • EasyProject
  • EasySchool
  • EasyStatus
  • exApiController1
  • exBlade1
  • exClass
  • exData1
  • exMail1
  • exRoute1
  • exTranslate1
  • exUrl1
  • FileManager1
  • FilePref1
  • Form1
  • Function1
  • Header1
  • Html1
  • HtmlAsset1
  • HtmlForm1
  • HtmlStyle1
  • HtmlWidget1
  • Math1
  • Model1
  • Model1FileLocator
  • Number1
  • Object1
  • Page1
  • Picture1
  • Popup1
  • QUESTION_TYPE
  • RecursiveArrayObject1
  • RegEx1
  • ResultObject1
  • ResultStatus1
  • ServerRequest1
  • Session1
  • SessionPreferenceSave1
  • String1
  • TaskManager1
  • Url1
  • Validation1
  • Value1

Interfaces

  • Controller1RouteInterface
  • Model1ActionInterface
  • Model1PageInterface

Functions

  • __
  • api_and_form_default_route
  • app
  • app_api_list
  • app_class_list
  • app_class_paths
  • app_class_with_interface
  • app_controller_list
  • app_dashboard_list
  • app_db_model_list
  • app_db_table_list
  • app_model_list
  • app_page_list
  • asset
  • csrf_token
  • current_layout_asset
  • current_plugin_asset
  • current_resources_asset_path
  • d
  • dd
  • file_base
  • file_session
  • file_session_get
  • file_session_remove
  • file_session_save
  • form_call_api
  • form_call_controller
  • form_token
  • get_all_view_in_directory
  • get_valid_view_path
  • is_token_valid
  • is_ajax_request
  • layout_asset
  • mailer
  • mailer_send_mail_to_list
  • make_default_route
  • makeRoute
  • normalizeSharedPath
  • now
  • now_date
  • now_time
  • old
  • paginate
  • path_app
  • path_asset
  • path_asset_url
  • path_clear_cache
  • path_main
  • path_main_url
  • path_shared
  • path_shared_app
  • path_shared_asset
  • path_shared_asset_url
  • path_shared_resources
  • path_to_viewpath
  • plugin_asset
  • pre
  • redirect
  • redirect_back
  • redirect_failed
  • redirect_to_view
  • register_path_for_layout_asset
  • request
  • resources_path
  • resources_path_asset
  • resources_path_cache
  • resources_path_plugin
  • resources_path_view
  • resources_path_view_cache
  • resources_path_view_layout
  • route
  • routes
  • shared_asset
  • token
  • translate_language
  • translated_language
  • url
  • view
  • view_exists
  • view_make
  • viewpath_to_path
  • Overview
  • Class

Class String1

Located at easycore/Ehex.php
Methods summary
public static mixed
# compressMD5( $md5_hash_str )

Return 22-char compressed version of 32-char hex string (eg from PHP md5). adn URL Safe

Return 22-char compressed version of 32-char hex string (eg from PHP md5). adn URL Safe

Parameters

$md5_hash_str

Returns

mixed
public static mixed
# compressHash( $hash )

If you now want a function to compress your hexadecimal MD5 values using URL safe characters, you can use this:

If you now want a function to compress your hexadecimal MD5 values using URL safe characters, you can use this:

Parameters

$hash

Returns

mixed
public static mixed
# uncompressHash( $hash )

And the inverse function:

And the inverse function:

Parameters

$hash

Returns

mixed
public static string
# base64_to_base64UrlSafe( $base64 )

If you need Base-64 encoding with the URL and filename safe alphabet , you can use these functions:

If you need Base-64 encoding with the URL and filename safe alphabet , you can use these functions:

Parameters

$base64

Returns

string
public static string
# base64UrlSafe_to_base64( $base64safe )

Parameters

$base64safe

Returns

string
public static string
# base16_to_base64( $base16 )

Here are two conversion functions for Base-16 to Base-64 conversion and the inverse Base-64 to Base-16 for arbitrary input lengths:

Here are two conversion functions for Base-16 to Base-64 conversion and the inverse Base-64 to Base-16 for arbitrary input lengths:

Parameters

$base16

Returns

string
public static string
# base64_to_base16( $base64 )

And the inverse function:

And the inverse function:

Parameters

$base64

Returns

string
public static null|string|string[]
# pluralize( $string )

pluralize value

pluralize value

Parameters

$string

Returns

null|string|string[]
public static null|string|string[]
# singularize( $string )

singularize value

singularize value

Parameters

$string

Returns

null|string|string[]
public static string
# pluralize_if( $count, $string )

Pluralize value only if count > 0

Pluralize value only if count > 0

Parameters

$count
$string

Returns

string
public static
# isUpperCase( $string )
public static
# isLowerCase( $string )
public static string
# stringBetween( $haystack, $start, $end )

Returns the first string there is between the strings from the parameter start and end. stringBetween('This is a [custom] string', '[', ']'); // custom

Returns the first string there is between the strings from the parameter start and end. stringBetween('This is a [custom] string', '[', ']'); // custom

Parameters

$haystack
$start
$end

Returns

string
public static string
# convertToSnakeCase( $input, string $delimiter = '_' )

Parameters

$input
$delimiter

Returns

string
To convertCamelCase_toSnakeCase I.E FirstName = first_name
public static string
# convertToCamelCase( $input, string $underScore_replace_with = '' )

Parameters

$input
$underScore_replace_with

Returns

string

To convertSnakeCase_toCamelCase I.E first_name = FirstName To convertSnakeCase_toCamelCase I.E first_name = FirstName

public static mixed
# convertWordToSlug( $word )

Parameters

$word

Returns

mixed

echo create_slug('does this thing work or not'); //returns 'does-this-thing-work-or-not'

public static string
# convertMySqlDataTypeToPhp( string $dataType = 'varchar' )

get mysql variable from php variable

get mysql variable from php variable

Parameters

$dataType

Returns

string
public static mixed
# replaceAccents( $var )

Normalize Character and replace for accents catalan spanish and more

Normalize Character and replace for accents catalan spanish and more

Parameters

$var

Returns

mixed
public static
# toString( $value, $delimiter = ' ' )
public static
# getDemoText( $length = 500, $isPassword = false, $shuffleString = true )
public static
# mask( $text, $start_from = 1, $maskKey = '*', $length = 20 )
public static float|integer
# hashCode( $value )

get string hash code

get string hash code

Parameters

$value

Returns

float|integer
public static string
# escapeQuotes( string $value = 'ade is a "fine" Boy', boolean $toJavascript = false )

remove trailing quote

remove trailing quote

Parameters

$value
$toJavascript

Returns

string
public static string
# escapeStringAsEntity( string $value )

remove special character in string value

remove special character in string value

Parameters

$value

Returns

string
public static
# startsWith( $string, $needleToSearch )
public static
# endsWith( $string, $needleToSearch )
public static
# replace( $text, $search, $replace )
public static
# replaceStart( $text, $search, $replace )
public static
# replaceEnd( $text, $search, $replace )
public static string
# hereDocMoonWalk( $x, integer $leadingSpaces = 0 )

Removes trailing indentation in HEREDOC strings and other strings with multiple lines.

Parameters

$x
$leadingSpaces

Returns

string
public static
# toArray( $text, $delimiter = '' )
public static
# fetchSynonyms( $word )
public static mixed|null|string|string[]
# translateLanguage( $text, string $fromLanguage = 'nl', string $toLanguage = 'en', boolean $cache = false, boolean $returnDefaultOnFailed = true )

Translate Text

Translate Text

Parameters

$text
$fromLanguage
$toLanguage
$cache
$returnDefaultOnFailed

Returns

mixed|null|string|string[]
public static array
# translateLanguageKeyValue( array $textKeyValueList = [], string $fromLanguage = 'en', string $toLanguage = 'en', boolean $cache = true, boolean $returnDefaultOnFailed = true )

Translate Text and Cached It

Translate Text and Cached It

Parameters

$textKeyValueList
$fromLanguage
$toLanguage
$cache
$returnDefaultOnFailed

Returns

array

Example, and Array of $food = ['dinner'=>'pie', 'breakfast'=>'moimoi'] Example, and Array of $food = ['dinner'=>'pie', 'breakfast'=>'moimoi'] Would be converted to dinner=pie & breakfast=moimoi. as Sending Request then output ['dinner'=>'ahfdk', 'breakfast'=>'asfas']

public static boolean|mixed
# translateLanguageKeyAndManyValues( array $textKeyValueList = [], string $fromLanguage = 'en', string $toLanguage = 'en', boolean $cache = true, string $defaultKey = 'default' )

Translate Text and Cached it

Translate Text and Cached it

Parameters

$textKeyValueList
$fromLanguage
$toLanguage
$cache
$defaultKey

Returns

boolean|mixed
public static null|string|string[]
# decodeUnicode( $text )

DeEncode from Unicode

DeEncode from Unicode

Parameters

$text

Returns

null|string|string[]
public static string
# encodeStringToNumber( $string )

Encode to Number

Encode to Number

Parameters

$string

Returns

string
public static string
# decodeStringBackFromNumber( $stringNumber )

DeEncode From Number

DeEncode From Number

Parameters

$stringNumber

Returns

string
public static string
# encodeToShortAlphaNum( $string )

Encode to Short Alpha Numeric

Encode to Short Alpha Numeric

Parameters

$string

Returns

string
public static string
# decodeFromShortAlphaNum( $string )

Parameters

$string

Returns

string
public static boolean
# isHashEquals( $str1, $str2 )

Parameters

$str1
$str2

Returns

boolean
public static boolean|string
# random( integer $length = 10, null $uniqueId = null )

Generate Random String

Generate Random String

Parameters

$length
$uniqueId

Returns

boolean|string
public static boolean|string
# repeat( string $value = '', integer $repeatCount = 2 )

Re-Show inserted string in count (n) time

Re-Show inserted string in count (n) time

Parameters

$value
$repeatCount

Returns

boolean|string
public static boolean|string
# getSubString( $text, $length, integer $start = 0 )

Parameters

$text
$length
$start

Returns

boolean|string
public static string
# getSomeText( $text, string $length = '20', string $ellipsis = '...' )

Get Small Text Out of Large Text

Get Small Text Out of Large Text

Parameters

$text
$length
$ellipsis

Returns

string
public static boolean
# contains( $needle, $haystack )

Parameters

$needle
$haystack

Returns

boolean
public static boolean|string
# containsMany( array $needles, $haystack, string $operator = 'or', boolean $asWord = false )

Parameters

$needles
$haystack
$operator
$asWord

Returns

boolean|string
public static boolean
# toBoolean( $value, boolean $trueValue = true, boolean $falseValue = false )

Parameters

$value
$trueValue
$falseValue

Returns

boolean
public static
# containsWord( $text, $wholeWordToFind )
public static null|string|string[]
# removeBracket( $str, string $replaceWith = '' )

Parameters

$str
$replaceWith

Returns

null|string|string[]
public static boolean|string
# leftTrim( $string, string $removeString = '' )

Parameters

$string
$removeString

Returns

boolean|string
public static
# toArrayTree( $array, $delimiter = ',' )
public static boolean
# is_empty( & $data, boolean $stringScan = true )

Pointer Data if Data not null or empty

Pointer Data if Data not null or empty

Parameters

$data
$stringScan

Returns

boolean
public static boolean
# isEmpty( $data, boolean $stringScan = true )

Non-Pointer Data if Data not null or empty

Non-Pointer Data if Data not null or empty

Parameters

$data
$stringScan

Returns

boolean
public static string
# if_empty( & $data, string $thenValue = '', string $elseValue = '' )

Pointer, if Empty Then Return , Or ELse

Pointer, if Empty Then Return , Or ELse

Parameters

$data
$thenValue
$elseValue

Returns

string
public static string
# ifEmpty( & $data, string $thenValue = '', string $elseValue = '' )

Non-Pointer, if Empty Then Return , Or ELse

Non-Pointer, if Empty Then Return , Or ELse

Parameters

$data
$thenValue
$elseValue

Returns

string
public static string
# ifNotEmpty( $data, string $thenValue = '', string $elseValue = '' )

not empty

not empty

Parameters

$data
$thenValue
$elseValue

Returns

string
public static string
# IfThen( $data, string $thenValue = '', string $elseValue = '' )

main If function

main If function

Parameters

$data
$thenValue
$elseValue

Returns

string
public static string
# isset_or( & $data, string $defaultValue_IfNotSet = "" )

Pointer , If Value isSet or Value Not Null or Empty then return Value Else Return DefaultValue

Pointer , If Value isSet or Value Not Null or Empty then return Value Else Return DefaultValue

Parameters

$data
$defaultValue_IfNotSet

Returns

string
public static string
# isSetOr( $data, string $defaultValue_IfNotSet = "" )

Non-Pointer , If Value isSet or Value Not Null or Empty then return Value Else Return DefaultValue

Non-Pointer , If Value isSet or Value Not Null or Empty then return Value Else Return DefaultValue

Parameters

$data
$defaultValue_IfNotSet

Returns

string
public static boolean|mixed
# isset_any( mixed $valueListInAscendingOrder )

Many Confirmation

Many Confirmation

Parameters

$valueListInAscendingOrder
$valueListInAscendingOrder

Returns

boolean|mixed
public static mixed|null
# useAvailableValue( array $valueListInAscendingOrder )

Return Any Not Empty or Null Value

Return Any Not Empty or Null Value

Parameters

$valueListInAscendingOrder
$valueListInAscendingOrder

Returns

mixed|null
public static string
# nullTo( $data, string $defaultValue = '' )

Instantiate Null Value to Given Value

Instantiate Null Value to Given Value

Parameters

$data
$defaultValue

Returns

string
public static mixed|string
# ifKeyIsTrue_returnKeyValue( array $keyValueArray = [], string $else = '' )

Parameters

$keyValueArray
$else

Returns

mixed|string
(return array key value if it's key = true... otherwise if none key is true, return $else variable)
public static
# ifKeyEqualValue( $equalKeyValueList = [], $IfEqualThen = "active", $else = '' )
public static
# ifAllValueEquals( $then, $else, $valueList )
public static
# isAllTrue( $conditionValueList )
public static
# isAnyTrue( $conditionValueList )
API documentation generated by ApiGen