Docs | Utilities | PHP | Strings
description Lots of utility string conversions
type php
source src\dvc\strings.php

Functions (public)

Dates
  • asLocalDate( $date, $time = false, $epoch = 0)

  print strings::asLocalDate( '2020-12-01');  // In Austalia : 2020-12-01

  • asShortDate( $date, $time = false)

  print strings::asShortDate( '2021-12-01');  // In Austalia : 01-Dec

  • asLongDate( $date, $time = false)

  print strings::asLongDate( '2020-12-01');  // Tue 01 Dec 2020
  print strings::asLongDate( '2020-12-01 14:30:00', $time = true);  // Tue 01 Dec 2020 2:30p

Telephone Numbers

using giggsey : https://github.com/giggsey/libphonenumber-for-php

  • asLocalPhone( $_tel = '' )

    print strings::asLocalPhone( '0755332255');  // In Austalia : (07) 5533 2255

  • asMobilePhone( $mobile = '' ) - alias for asLocalPhone
Other ..
  • array2csv(array &$array)
  • BRITISHDateAsANSI( $strDate)
  • CheckEmailAddress( $email)
  • DateDiff( $date1, $date2 = null, $format = '%R%a')
  • endswith($string, $test)
  • getCommonPath( array $paths)
  • getRelativePath( string $from, string $to, string $ps = DIRECTORY_SEPARATOR)
  • getDateAsANSI( $strDate)
  • getGUID()
  • getUID()
  • html2text($document)
  • htmlSanitize( $html )
  • initials( $name )
  • InLocalTimeZone($format="r", $timestamp=false, $timezone=false)
  • isValidMd5($md5 ='')
  • IsEmailAddress( $email)
  • isEmail( $email)
  • isMobilePhone( string $_tel = '')
  • isPhone( string $_tel = '')
  • isOurEmailDomain( $email)
  • lorum()
    • prints out some lorum ispum
  • pixel()
  • rand( $prefix = 'uid_')
  • replaceWordCharacters( $text)
  • SmartCase($name)
  • text2html( $inText, $maxrows = -1, $allAsteriskAsList = false )
  • url( string $url = '', bool $protocol = false)
  • xml_entities($text, $charset = 'UTF-8')