7. Format methods - adwins/Arrayer GitHub Wiki
7. Format methods.
Format methods.
/** * Format methods return new Arrayer object /** * Formats a string according to a $format. */ $arrayer->var->format('%s'); /** * Formats a string as date. */ $arrayer->var->as_date($format = 'Y-m-d') /** * Gets a string (in specified charset $to_charset). */ $arrayer->var->as_string([ $to_charset=null ]); /** * Gets a string in lower case. */ $arrayer->var->as_lower(); /** * Gets a string in upper case. */ $arrayer->var->as_upper(); /** * Respells (transliterates) the string value. */ $arrayer->var->respell(); /** * Creates a URL safe name from a string, respelling it and cleaning characters. */ $arrayer->var->as_safe_name(); /** * Escapes string (htmlspecialchars). */ $arrayer->var->escape() /** * Hashes string to md5 with given $salt. */ $arrayer->var->md5([ $salt = '' ]) /** * Hashes string to sha1 with given $salt. */ $arrayer->var->sha1([ $salt = '' ]); /** * Hashes string to crypt with given $salt. */ $arrayer->var->crypt([ $salt = null ]); /** * Hashes string to sha256. */ $arrayer->var->sha256(); /** * Gets CRC32 of the string value. */ $arrayer->var->crc32(); /** * Reverses the string value. */ $arrayer->var->rev(); /** * Gets the substring of the string value specified by the $start and $len parameters. */ $arrayer->var->substr($start [, $len = null ]); /** * Chunks the string value by $chunklen */ $arrayer->var->chunk([ $chunklen = 76 [, $end = "\r\n" ] ]); /** * Encodes the string value with base64. * $as_mail = true adds special mime header */ $arrayer->var->base64([ $as_mail = false ]); /** * Decodes the string value with base64. */ $arrayer->var->base64_decode(); /** * Converts the string value to a quoted-printable string. * $as_mail = true adds special mime header */ $arrayer->var->quoted([ $as_mail = false ]); /** * Converts the quoted-printable string value to a string value. */ $arrayer->var->quoted_decode(); /** * Converts the MIME string to a string (from base64 or quoted_printable). */ $arrayer->var->mime_string_decode(); /** * Converts the IP to a Hex value. */ $arrayer->var->ip2hex(); /** * Converts the Hex value to an IP. */ $arrayer->var->hex2ip();